Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
chore: merge upstream branch gradle/master into main
Browse files Browse the repository at this point in the history
This commit synchronizes the latest 5 changes from the https://github.com/gradle/gradle/tree/master. The changes include:

dc80156: gradle/gradle#27181 Add 'CaptureStateBeforeExecutionStep$Operation$Details' class to removed-types.txt
d14842d: Move setupLocalBuildCache() method to AbstractSmokeTest
b7e79e7: Don't reuse local build cache in all BuildScanPluginSmokeTest
37406c3: Use a separate build cache folder for BuildScanPluginSmokeTest
99cde69: Add 'CaptureStateBeforeExecutionStep$Operation$Details' class to removed-types.txt
  • Loading branch information
meowool-bot committed Nov 28, 2023
2 parents 6f5968f + dc80156 commit f776486
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 f776486

Please sign in to comment.