Enable configuration cache Test: running some tests locally Change-Id: Ie05a6566477411083d880723ae04960132a4a673
diff --git a/d8_r8/test/build.gradle.kts b/d8_r8/test/build.gradle.kts index 343ceb2..cbfd3ed 100644 --- a/d8_r8/test/build.gradle.kts +++ b/d8_r8/test/build.gradle.kts
@@ -111,7 +111,8 @@ val packageTests = register<Jar>("packageTests") { - from(testJars.elements.map { it.map { zipTree(it) } }) + val injected = project.objects.newInstance<InjectedArcOps>() + from(testJars.elements.map { it.map { injected.arcOps.zipTree(it) } }) exclude("META-INF/*.kotlin_module", "**/*.kotlin_metadata") destinationDirectory.set(getRoot().resolveAll("build", "libs")) archiveFileName.set("r8tests.jar") @@ -119,8 +120,9 @@ val packageTestDeps = register<Jar>("packageTestDeps") { + val injected = project.objects.newInstance<InjectedArcOps>() dependsOn(keepAnnoAndroidXAnnotationsJarConfig) - from(testDepsJars.elements.map { it.map { zipTree(it) } }) + from(testDepsJars.elements.map { it.map { injected.arcOps.zipTree(it) } }) from(keepAnnoAndroidXAnnotationsJarConfig.map(::zipTree)) exclude("META-INF/*.kotlin_module", "**/*.kotlin_metadata", "org/jspecify/**", "org/jspecify") duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -130,7 +132,8 @@ val packageTestBase = register<Jar>("packageTestBase") { - from(testbaseTestJars.elements.map { it.map { zipTree(it) } }) + val injected = project.objects.newInstance<InjectedArcOps>() + from(testbaseTestJars.elements.map { it.map { injected.arcOps.zipTree(it) } }) exclude("META-INF/*.kotlin_module", "**/*.kotlin_metadata") destinationDirectory.set(getRoot().resolveAll("build", "libs")) archiveFileName.set("r8test_base.jar")
diff --git a/d8_r8/test_modules/tests_java_11/build.gradle.kts b/d8_r8/test_modules/tests_java_11/build.gradle.kts index e0dcbfe..b5f5d1f 100644 --- a/d8_r8/test_modules/tests_java_11/build.gradle.kts +++ b/d8_r8/test_modules/tests_java_11/build.gradle.kts
@@ -32,9 +32,6 @@ withType<JavaCompile> { dependsOn(sharedDepsConfig) } withType<Test> { - notCompatibleWithConfigurationCache( - "Failure storing the configuration cache: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache" - ) TestingState.setUpTestingState(this) javaLauncher = getJavaLauncher(Jdk.JDK_11) systemProperty(
diff --git a/d8_r8/test_modules/tests_java_17/build.gradle.kts b/d8_r8/test_modules/tests_java_17/build.gradle.kts index 09493d9..0fb4f04 100644 --- a/d8_r8/test_modules/tests_java_17/build.gradle.kts +++ b/d8_r8/test_modules/tests_java_17/build.gradle.kts
@@ -35,9 +35,6 @@ withType<JavaCompile> { dependsOn(sharedDepsConfig) } withType<Test> { - notCompatibleWithConfigurationCache( - "Failure storing the configuration cache: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache" - ) TestingState.setUpTestingState(this) javaLauncher = getJavaLauncher(Jdk.JDK_17) systemProperty(
diff --git a/d8_r8/test_modules/tests_java_21/build.gradle.kts b/d8_r8/test_modules/tests_java_21/build.gradle.kts index 523dcc4..c0d2acc 100644 --- a/d8_r8/test_modules/tests_java_21/build.gradle.kts +++ b/d8_r8/test_modules/tests_java_21/build.gradle.kts
@@ -49,9 +49,6 @@ withType<JavaCompile> { dependsOn(sharedDepsConfig) } withType<Test> { - notCompatibleWithConfigurationCache( - "Failure storing the configuration cache: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache" - ) TestingState.setUpTestingState(this) javaLauncher = getJavaLauncher(Jdk.JDK_21) systemProperty(
diff --git a/d8_r8/test_modules/tests_java_25/build.gradle.kts b/d8_r8/test_modules/tests_java_25/build.gradle.kts index 84de947..b6ea522 100644 --- a/d8_r8/test_modules/tests_java_25/build.gradle.kts +++ b/d8_r8/test_modules/tests_java_25/build.gradle.kts
@@ -32,9 +32,6 @@ withType<JavaCompile> { dependsOn(sharedDepsConfig) } withType<Test> { - notCompatibleWithConfigurationCache( - "Failure storing the configuration cache: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache" - ) TestingState.setUpTestingState(this) javaLauncher = getJavaLauncher(Jdk.JDK_25) systemProperty(
diff --git a/gradle.properties b/gradle.properties index ef1d755..f4debea 100644 --- a/gradle.properties +++ b/gradle.properties
@@ -15,7 +15,8 @@ org.gradle.parallel=true org.gradle.tooling.parallel=true org.gradle.caching=false -org.gradle.configuration-cache=false +org.gradle.configuration-cache=true +org.gradle.configuration-cache.problems=warn # Do not download any jdks or detect them. We provide them. org.gradle.java.installations.auto-detect=false