[Build] Avoid buildscript root capture into task action
#KT-44611 In Progress
This commit is contained in:
+5
-2
@@ -652,9 +652,12 @@ val syncMutedTests = tasks.register("syncMutedTests") {
|
||||
}
|
||||
|
||||
tasks.register("createIdeaHomeForTests") {
|
||||
outputs.file(ideaBuildNumberFileForTests())
|
||||
val ideaBuildNumberFileForTests = ideaBuildNumberFileForTests()
|
||||
val intellijSdkVersion = rootProject.extra["versions.intellijSdk"]
|
||||
outputs.file(ideaBuildNumberFileForTests)
|
||||
doFirst {
|
||||
writeIdeaBuildNumberForTests()
|
||||
ideaBuildNumberFileForTests.parentFile.mkdirs()
|
||||
ideaBuildNumberFileForTests.writeText("IC-$intellijSdkVersion")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,10 @@ val syncClasspath by tasks.register<Sync>("syncClasspath") {
|
||||
from(incomingClasspath)
|
||||
into(classpathDestination)
|
||||
|
||||
val testedVersionLocal = testedVersion
|
||||
/* Test if the correct version was resolved */
|
||||
doLast {
|
||||
val expectedJar = destinationDir.resolve("kotlin-gradle-plugin-idea-$testedVersion.jar")
|
||||
val expectedJar = destinationDir.resolve("kotlin-gradle-plugin-idea-$testedVersionLocal.jar")
|
||||
check(expectedJar.exists()) { "Expected $expectedJar in classpath. Found ${destinationDir.listFiles().orEmpty()}" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,10 @@ run {
|
||||
|
||||
tasks.test {
|
||||
dependsOnKotlinGradlePluginInstall()
|
||||
inputs.files(compatibilityTestClasspath)
|
||||
doFirst { systemProperty("compatibilityTestClasspath", compatibilityTestClasspath.files.joinToString(";") { it.absolutePath }) }
|
||||
dependsOn(compatibilityTestClasspath)
|
||||
val conf: FileCollection = compatibilityTestClasspath
|
||||
inputs.files(conf)
|
||||
doFirst { systemProperty("compatibilityTestClasspath", conf.files.joinToString(";") { it.absolutePath }) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,13 +95,15 @@ projectTest(jUnitMode = JUnitMode.JUnit5) {
|
||||
workingDir = rootDir
|
||||
useAndroidJar()
|
||||
|
||||
val parcelizeRuntimeForTestsProvider = project.provider { parcelizeRuntimeForTests.asPath }
|
||||
val robolectricClasspathProvider = project.provider { robolectricClasspath.asPath }
|
||||
val parcelizeRuntimeForTestsConf: FileCollection = parcelizeRuntimeForTests
|
||||
val robolectricClasspathConf: FileCollection = robolectricClasspath
|
||||
val layoutLibConf: FileCollection = layoutLib
|
||||
val layoutLibApiConf: FileCollection = layoutLibApi
|
||||
doFirst {
|
||||
systemProperty("parcelizeRuntime.classpath", parcelizeRuntimeForTestsProvider.get())
|
||||
systemProperty("robolectric.classpath", robolectricClasspathProvider.get())
|
||||
systemProperty("layoutLib.path", layoutLib.singleFile.canonicalPath)
|
||||
systemProperty("layoutLibApi.path", layoutLibApi.singleFile.canonicalPath)
|
||||
systemProperty("parcelizeRuntime.classpath", parcelizeRuntimeForTestsConf.asPath)
|
||||
systemProperty("robolectric.classpath", robolectricClasspathConf.asPath)
|
||||
systemProperty("layoutLib.path", layoutLibConf.singleFile.canonicalPath)
|
||||
systemProperty("layoutLibApi.path", layoutLibApiConf.singleFile.canonicalPath)
|
||||
}
|
||||
doLast {
|
||||
println(filter)
|
||||
|
||||
Reference in New Issue
Block a user