|
|
@ -57,18 +57,29 @@ val jar = tasks.named<Jar>("jar") { |
|
|
|
this.duplicatesStrategy = DuplicatesStrategy.INCLUDE |
|
|
|
this.duplicatesStrategy = DuplicatesStrategy.INCLUDE |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val gradleVersionForTests = "6.7" |
|
|
|
val minGradleVersionForTests = "6.4" |
|
|
|
|
|
|
|
val maxGradleVersionForTests = "6.7" |
|
|
|
val java14Home: String? = when (JavaVersion.current()) { |
|
|
|
val java14Home: String? = when (JavaVersion.current()) { |
|
|
|
JavaVersion.VERSION_14 -> System.getProperty("java.home") |
|
|
|
JavaVersion.VERSION_14 -> System.getProperty("java.home") |
|
|
|
else -> System.getenv("JDK_14") |
|
|
|
else -> System.getenv("JDK_14") |
|
|
|
} |
|
|
|
} |
|
|
|
val isWindows = getCurrentOperatingSystem().isWindows |
|
|
|
val isWindows = getCurrentOperatingSystem().isWindows |
|
|
|
|
|
|
|
|
|
|
|
afterEvaluate { |
|
|
|
tasks.test { |
|
|
|
tasks.named<Test>("test") { |
|
|
|
configureTest(maxGradleVersionForTests) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tasks.register("testMinGradleVersion", Test::class.java) { |
|
|
|
|
|
|
|
tasks.test.get().let { defaultTest -> |
|
|
|
|
|
|
|
classpath = defaultTest.classpath |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
configureTest(minGradleVersionForTests) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun Test.configureTest(gradleVersion: String) { |
|
|
|
dependsOn("publishToMavenLocal") |
|
|
|
dependsOn("publishToMavenLocal") |
|
|
|
systemProperty("compose.plugin.version", BuildProperties.deployVersion(project)) |
|
|
|
systemProperty("compose.plugin.version", BuildProperties.deployVersion(project)) |
|
|
|
systemProperty("gradle.version.for.tests", gradleVersionForTests) |
|
|
|
systemProperty("gradle.version.for.tests", gradleVersion) |
|
|
|
|
|
|
|
|
|
|
|
if (java14Home != null) { |
|
|
|
if (java14Home != null) { |
|
|
|
val executableFileName = if (isWindows) "java.exe" else "java" |
|
|
|
val executableFileName = if (isWindows) "java.exe" else "java" |
|
|
@ -76,5 +87,4 @@ afterEvaluate { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
doFirst { error("Use JDK 14 to run tests or set up JDK_14 env. var") } |
|
|
|
doFirst { error("Use JDK 14 to run tests or set up JDK_14 env. var") } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |