File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
src/test/kotlin/kotlinx/rpc/base Expand file tree Collapse file tree 2 files changed +7
-8
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" )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments