Skip to content

Commit

Permalink
Merge pull request gradle#27181 Add 'CaptureStateBeforeExecutionStep$…
Browse files Browse the repository at this point in the history
…Operation$Details' class to removed-types.txt

Develocity plugin references that class in versions `3.13` and up, and by removing that class we broke the plugin. This fixes it.
Also, now we tests Develocity plugin with `--build-cache` that reproduces the issue.

Co-authored-by: Anže Sodja <asodja@gradle.com>
  • Loading branch information
bot-gradle and asodja committed Nov 28, 2023
2 parents 0731115 + d14842d commit dc80156
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -360,6 +362,7 @@ class BuildScanPluginSmokeTest extends AbstractSmokeTest {
"""
}

setupLocalBuildCache()
setupJavaProject()
}

Expand Down

0 comments on commit dc80156

Please sign in to comment.