Skip to content

Commit

Permalink
fix: replace System.getProperty with System.getenv
Browse files Browse the repository at this point in the history
Tested-by: Pranav Purwar <[email protected]>
Signed-off-by: PranavPurwar <[email protected]>
  • Loading branch information
PranavPurwar committed Sep 30, 2023
1 parent e006267 commit f33d247
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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\"")
}

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit f33d247

Please sign in to comment.