[Build] Avoid buildscript root capture into task action

#KT-44611 In Progress
This commit is contained in:
Alexander Likhachev
2022-04-11 22:24:54 +03:00
parent 64aae756d1
commit eda759ba31
4 changed files with 19 additions and 11 deletions
@@ -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 }) }
}
}