Skip to content

Commit 2fb3168

Browse files
committed
small fixes
1 parent 2b45842 commit 2fb3168

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

gradle-plugin/build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
66
import util.other.generateSource
77
import kotlin.io.path.Path
88
import kotlin.io.path.absolutePathString
9+
import kotlin.io.path.exists
910
import kotlin.io.path.readLines
1011

1112
plugins {
@@ -109,9 +110,11 @@ generateSource(
109110
val globalRootDir: String by extra
110111

111112
val 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")

gradle-plugin/src/test/kotlin/kotlinx/rpc/base/BaseTest.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,11 @@ abstract class BaseTest {
168168
.withProjectDir(projectDir.absolute().toFile())
169169
.withTestKitDir(testKitDir.absolute().toFile())
170170
.withGradleVersion(versions.gradle)
171-
.forwardOutput()
172171
.withEnvironment(mapOf("ANDROID_HOME" to ANDROID_HOME_DIR))
173172
.withArguments(
174173
listOfNotNull(
175174
task,
176175
"--stacktrace",
177-
"--info",
178176
"-Dorg.gradle.kotlin.dsl.scriptCompilationAvoidance=false",
179177
*args,
180178
)
@@ -192,15 +190,13 @@ abstract class BaseTest {
192190
val versions: VersionsEnv,
193191
) {
194192
val projectDir: Path get() = this@BaseTest.projectDir
195-
var latestBuild: BuildResult? = null
196-
private set
197193

198194
fun runGradle(
199195
task: String,
200196
vararg args: String,
201197
): BuildResult {
202198
return runGradleInternal(task, versions, *args) {
203-
build().also { latestBuild = it }
199+
build()
204200
}
205201
}
206202

@@ -209,7 +205,7 @@ abstract class BaseTest {
209205
vararg args: String,
210206
): BuildResult {
211207
return runGradleInternal(task, versions, *args) {
212-
buildAndFail().also { latestBuild = it }
208+
buildAndFail()
213209
}
214210
}
215211

0 commit comments

Comments
 (0)