mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 00:02:06 +01:00
Add check if ANDROID_HOME is set to build.gradle
This commit is contained in:
parent
b6285679cd
commit
ccdd94c997
1 changed files with 13 additions and 5 deletions
18
build.gradle
18
build.gradle
|
@ -312,8 +312,7 @@ def getGitCommit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
def getAndroidRuntimeJar() {
|
def getAndroidRuntimeJar() {
|
||||||
def androidHome = new File("$System.env.ANDROID_HOME")
|
def androidHome = getAndroidHome()
|
||||||
if (!androidHome.isDirectory()) throw new Exception("ANDROID_HOME not found or set")
|
|
||||||
def androidJar = new File("$androidHome/platforms/android-$smackMinAndroidSdk/android.jar")
|
def androidJar = new File("$androidHome/platforms/android-$smackMinAndroidSdk/android.jar")
|
||||||
if (androidJar.isFile()) {
|
if (androidJar.isFile()) {
|
||||||
return androidJar
|
return androidJar
|
||||||
|
@ -323,7 +322,16 @@ def getAndroidRuntimeJar() {
|
||||||
}
|
}
|
||||||
|
|
||||||
def getAndroidJavadocOffline() {
|
def getAndroidJavadocOffline() {
|
||||||
def androidHome = new File("$System.env.ANDROID_HOME")
|
def androidHome = getAndroidHome()
|
||||||
if (!androidHome.isDirectory()) throw new Exception("ANDROID_HOME not found or set")
|
return androidHome.toString() + "/docs/reference"
|
||||||
return "$System.env.ANDROID_HOME" + "/docs/reference"
|
}
|
||||||
|
|
||||||
|
def getAndroidHome() {
|
||||||
|
def androidHomeEnv = System.getenv("ANDROID_HOME")
|
||||||
|
if (androidHomeEnv == null) {
|
||||||
|
throw new Exception("ANDROID_HOME environment variable is not set")
|
||||||
|
}
|
||||||
|
def androidHome = new File(androidHomeEnv)
|
||||||
|
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
|
||||||
|
return androidHome
|
||||||
}
|
}
|
Loading…
Reference in a new issue