From f33d2475893374b05dab22c346a9965024849ae0 Mon Sep 17 00:00:00 2001 From: PranavPurwar Date: Sat, 30 Sep 2023 19:02:50 +0530 Subject: [PATCH] fix: replace `System.getProperty` with `System.getenv` Tested-by: Pranav Purwar Signed-off-by: PranavPurwar --- app/build.gradle.kts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e83a789b2..25470787b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,6 +11,8 @@ plugins { id("dev.rikka.tools.materialthemebuilder") } +apply from ('https://raw2.github.com/cookpad/gradle-android-sdk-manager/master/sdk_manager.gradle' + android { namespace = "org.cosmicide" compileSdk = 34 @@ -22,8 +24,8 @@ android { applicationId = "org.cosmicide" minSdk = 26 targetSdk = 34 - versionCode = 20 - versionName = "2.0" + versionCode = 22 + versionName = "2.2" buildConfigField("String", "GIT_COMMIT", "\"$commit\"") } @@ -242,7 +244,11 @@ dependencies { // Fetches Android SDK root fun getSdkDir(): File { - var sdk = System.getProperty("ANDROID_HOME") + var sdk = System.getenv("ANDROID_HOME") + + if (sdk.isNullOrBlank()) { + sdk = System.getenv("ANDROID_SDK") + } if (sdk.isNullOrBlank()) { val f = File(System.getProperty("user.dir") + "/local.properties")