[Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3 There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242 ^KTI-1473 In Progress
This commit is contained in:
committed by
Space Team
parent
b784544f8d
commit
a19bd2ed2e
@@ -68,7 +68,7 @@ javadocJar()
|
||||
|
||||
testsJar()
|
||||
|
||||
val robolectricDependencyDir = "$buildDir/robolectricDependencies"
|
||||
val robolectricDependencyDir = layout.buildDirectory.dir("robolectricDependencies")
|
||||
val prepareRobolectricDependencies by tasks.registering(Copy::class) {
|
||||
from(robolectricDependency)
|
||||
into(robolectricDependencyDir)
|
||||
@@ -100,7 +100,7 @@ projectTest {
|
||||
systemProperty("robolectric.classpath", robolectricClasspathProvider.get())
|
||||
|
||||
systemProperty("robolectric.offline", "true")
|
||||
systemProperty("robolectric.dependency.dir", robolectricDependencyDir)
|
||||
systemProperty("robolectric.dependency.dir", robolectricDependencyDir.get().asFile)
|
||||
|
||||
systemProperty("layoutLib.path", layoutLibConf.singleFile.canonicalPath)
|
||||
systemProperty("layoutLibApi.path", layoutLibApiConf.singleFile.canonicalPath)
|
||||
|
||||
@@ -168,7 +168,7 @@ projectTest(jUnitMode = JUnitMode.JUnit5) {
|
||||
// Exclude all tests with the "atomicfu-native" tag. They should be launched by another test task.
|
||||
excludeTags("atomicfu-native")
|
||||
}
|
||||
useJsIrBoxTests(version = version, buildDir = "$buildDir/")
|
||||
useJsIrBoxTests(version = version, buildDir = layout.buildDirectory)
|
||||
|
||||
workingDir = rootDir
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ projectTest(parallel = true, jUnitMode = JUnitMode.JUnit5) {
|
||||
val generateTests by generator("org.jetbrains.kotlinx.serialization.TestGeneratorKt")
|
||||
|
||||
fun Test.setUpJsIrBoxTests() {
|
||||
useJsIrBoxTests(version = version, buildDir = "$buildDir/")
|
||||
useJsIrBoxTests(version = version, buildDir = layout.buildDirectory)
|
||||
|
||||
val localJsCoreRuntimeForTests: FileCollection = coreJsIrRuntimeForTests
|
||||
val localJsJsonRuntimeForTests: FileCollection = jsonJsIrRuntimeForTests
|
||||
|
||||
@@ -87,7 +87,7 @@ sourcesJar()
|
||||
javadocJar()
|
||||
testsJar()
|
||||
|
||||
val robolectricDependencyDir = "$buildDir/robolectricDependencies"
|
||||
val robolectricDependencyDir = layout.buildDirectory.dir("robolectricDependencies")
|
||||
val prepareRobolectricDependencies by tasks.registering(Copy::class) {
|
||||
from(robolectricDependency)
|
||||
into(robolectricDependencyDir)
|
||||
@@ -113,7 +113,7 @@ projectTest(jUnitMode = JUnitMode.JUnit5) {
|
||||
systemProperty("robolectric.classpath", robolectricClasspathConf.asPath)
|
||||
|
||||
systemProperty("robolectric.offline", "true")
|
||||
systemProperty("robolectric.dependency.dir", robolectricDependencyDir)
|
||||
systemProperty("robolectric.dependency.dir", robolectricDependencyDir.get().asFile)
|
||||
|
||||
systemProperty("layoutLib.path", layoutLibConf.singleFile.canonicalPath)
|
||||
systemProperty("layoutLibApi.path", layoutLibApiConf.singleFile.canonicalPath)
|
||||
|
||||
Reference in New Issue
Block a user