diff --git a/subprojects/core/src/main/resources/org/gradle/initialization/removed-types.txt b/subprojects/core/src/main/resources/org/gradle/initialization/removed-types.txt index 3a58ea98953f..055e9eb21023 100644 --- a/subprojects/core/src/main/resources/org/gradle/initialization/removed-types.txt +++ b/subprojects/core/src/main/resources/org/gradle/initialization/removed-types.txt @@ -24,3 +24,4 @@ org.gradle.api.artifacts.transform.ArtifactTransformException org.gradle.api.artifacts.transform.VariantTransform org.gradle.api.tasks.incremental.IncrementalTaskInputs org.gradle.workers.WorkerConfiguration +org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep$Operation$Details diff --git a/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/AbstractSmokeTest.groovy b/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/AbstractSmokeTest.groovy index 2aa45679a0e9..a4e08b35666b 100644 --- a/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/AbstractSmokeTest.groovy +++ b/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/AbstractSmokeTest.groovy @@ -35,6 +35,7 @@ import org.gradle.test.fixtures.dsl.GradleDsl import org.gradle.test.fixtures.file.TestFile import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.internal.DefaultGradleRunner +import org.gradle.util.internal.TextUtil import spock.lang.Specification import spock.lang.TempDir @@ -218,8 +219,9 @@ abstract class AbstractSmokeTest extends Specification { @TempDir File testProjectDir File buildFile - File settingsFile + @TempDir + File buildCacheDir def setup() { buildFile = new File(testProjectDir, defaultBuildFileName) @@ -357,6 +359,16 @@ abstract class AbstractSmokeTest extends Specification { file.text = text } + protected void setupLocalBuildCache() { + settingsFile << """ + buildCache { + local { + directory = new File("${TextUtil.normaliseFileSeparators(buildCacheDir.absolutePath)}") + } + } + """ + } + protected static String jcenterRepository(GradleDsl dsl = GROOVY) { RepoScriptBlockUtil.jcenterRepository(dsl) } diff --git a/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/BuildScanPluginSmokeTest.groovy b/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/BuildScanPluginSmokeTest.groovy index ac74d2d0d72f..b24cf0155fdf 100644 --- a/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/BuildScanPluginSmokeTest.groovy +++ b/subprojects/smoke-test/src/smokeTest/groovy/org/gradle/smoketests/BuildScanPluginSmokeTest.groovy @@ -288,6 +288,7 @@ class BuildScanPluginSmokeTest extends AbstractSmokeTest { systemProp.${ci.propPrefix}.gradle-enterprise.url=http://localhost:5086 """.stripIndent() + setupLocalBuildCache() setupJavaProject() if (doesNotBundleTestRetryPluginOrSupportsSafeMode(versionNumber)) { new TestFile(buildFile).with { @@ -329,7 +330,8 @@ class BuildScanPluginSmokeTest extends AbstractSmokeTest { } SmokeTestGradleRunner scanRunner(String... args) { - runner("build", "-Dscan.dump", *args).forwardOutput() + // Run with --build-cache to test also build-cache events + runner("build", "-Dscan.dump", "--build-cache", *args).forwardOutput() } void usePluginVersion(String version) { @@ -360,6 +362,7 @@ class BuildScanPluginSmokeTest extends AbstractSmokeTest { """ } + setupLocalBuildCache() setupJavaProject() }