File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
66import util.other.generateSource
77import kotlin.io.path.Path
88import kotlin.io.path.absolutePathString
9+ import kotlin.io.path.exists
910import kotlin.io.path.readLines
1011
1112plugins {
@@ -109,9 +110,11 @@ generateSource(
109110val globalRootDir: String by extra
110111
111112val androidHome = System .getenv(" ANDROID_HOME" )
113+ ? : System .getProperty(" ANDROID_SDK_HOME" )
112114 ? : Path (globalRootDir, " local.properties" )
113- .readLines()
114- .find { it.startsWith(" sdk.dir=" ) }
115+ .takeIf { it.exists() }
116+ ?.readLines()
117+ ?.find { it.startsWith(" sdk.dir=" ) }
115118 ?.substringAfter(" =" )
116119 ?.trim()
117120 ? : error(" ANDROID_HOME is not set" )
You can’t perform that action at this time.
0 commit comments