diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0cb4439..3aae9c21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,8 +6,8 @@ jobs: strategy: matrix: config: - - {os: ubuntu-latest, params: "-PtestAllSupportedGradleVersions=true build" } - - {os: ubuntu-latest, params: "-PtestAllSupportedGradleVersions=true pnpmTests" } + - {os: ubuntu-latest, params: "'-PtestedGradleVersion=5.6.4|6.0|7.0|7.4' pnpmTests" } + - {os: ubuntu-latest, params: "'-PtestedGradleVersion=5.6.4|6.0|7.0|7.4' build" } - {os: windows-latest, params: "build pnpmTests" } - {os: macos-latest, params: "build pnpmTests" } steps: diff --git a/build.gradle.kts b/build.gradle.kts index d5597999..6e2ecef9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,14 +65,6 @@ tasks.compileTestGroovy { tasks.withType(Test::class) { useJUnitPlatform() - systemProperty("testAllSupportedGradleVersions", project.properties["testAllSupportedGradleVersions"] ?: "false") - systemProperty( - "testMinimumSupportedGradleVersion", project.properties["testMinimumSupportedGradleVersion"] - ?: "false" - ) - systemProperty("testMinimumCurrentGradleVersion", project.properties["testMinimumCurrentGradleVersion"] ?: "false") - systemProperty("testCurrentGradleVersion", project.properties["testCurrentGradleVersion"] ?: "true") - systemProperty("testSpecificGradleVersion", project.properties["testSpecificGradleVersion"] ?: "false") systemProperty( com.github.gradle.buildlogic.GradleVersionsCommandLineArgumentProvider.PROPERTY_NAME, project.findProperty("testedGradleVersion") ?: gradle.gradleVersion @@ -94,6 +86,10 @@ tasks.withType(Test::class) { distribution { enabled.set(project.properties["com.github.gradle.node.testdistribution"].toString().toBoolean()) + remoteExecutionPreferred.set(project.properties["com.github.gradle.node.preferremote"].toString().toBoolean()) + if (project.properties["com.github.gradle.node.remoteonly"].toString().toBoolean()) { + maxLocalExecutors.set(0) + } } } @@ -118,6 +114,12 @@ tasks.register("testGradleReleases") { ) } +tasks.register("printVersions") { + doLast { + println(com.github.gradle.buildlogic.GradleVersionData::getReleasedVersions.invoke()) + } +} + tasks.register("testGradleNightlies") { jvmArgumentProviders.add( com.github.gradle.buildlogic.GradleVersionsCommandLineArgumentProvider( diff --git a/settings.gradle.kts b/settings.gradle.kts index 6ea09e04..ae6e8c1d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,11 +4,6 @@ plugins { id("com.gradle.enterprise.test-distribution") version "2.3.5" } -addScanProperty("testAllSupportedGradleVersions") -addScanProperty("testMinimumSupportedGradleVersion") -addScanProperty("testCurrentGradleVersion", "true") -addScanProperty("testSpecificGradleVersion") - val isCI = System.getenv().containsKey("CI") gradleEnterprise { @@ -30,13 +25,3 @@ gradleEnterprise { } rootProject.name = "gradle-node-plugin" - - -fun addScanProperty(name: String, default: String? = null) { - val property = extra.properties[name] as String? - if (property != null) { - if (default == null || default != property) { - gradleEnterprise.buildScan.value(name, property) - } - } -} \ No newline at end of file diff --git a/src/test/groovy/com/github/gradle/AbstractIntegTest.groovy b/src/test/groovy/com/github/gradle/AbstractIntegTest.groovy index 8eea8801..69cec25f 100644 --- a/src/test/groovy/com/github/gradle/AbstractIntegTest.groovy +++ b/src/test/groovy/com/github/gradle/AbstractIntegTest.groovy @@ -132,6 +132,7 @@ abstract class AbstractIntegTest extends Specification { if (explicitGradleVersions) { return explicitGradleVersions.split("\\|") .collect { GradleVersion.version(it)} + .unique() } else { [GradleVersion.current()] } diff --git a/src/test/groovy/com/github/gradle/GradleVersionsForTest.groovy b/src/test/groovy/com/github/gradle/GradleVersionsForTest.groovy deleted file mode 100644 index 2d971c53..00000000 --- a/src/test/groovy/com/github/gradle/GradleVersionsForTest.groovy +++ /dev/null @@ -1,36 +0,0 @@ -package com.github.gradle - -import org.gradle.util.GradleVersion - -class GradleVersionsForTest { - private static final GradleVersion MINIMUM_SUPPORTED_GRADLE_VERSION = GradleVersion.version("5.6.4") - private static final GradleVersion MINIMUM_GRADLE_6_VERSION = GradleVersion.version("6.0") - private static final GradleVersion CURRENT_GRADLE_VERSION = GradleVersion.current() - private static final GradleVersion GRADLE_7_VERSION = GradleVersion.version("7.0") - // Contains changes to configuration cache - private static final GradleVersion GRADLE_74_VERSION = GradleVersion.version("7.4") - private static final GradleVersion[] GRADLE_VERSIONS = - [MINIMUM_SUPPORTED_GRADLE_VERSION, MINIMUM_GRADLE_6_VERSION, CURRENT_GRADLE_VERSION, GRADLE_7_VERSION, - GRADLE_74_VERSION] - - static GradleVersion[] computeCandidateGradleVersions() { - def versions = [CURRENT_GRADLE_VERSION] - if (System.getProperty("testAllSupportedGradleVersions").equals("true")) { - return GRADLE_VERSIONS - } - if (System.getProperty("testMinimumSupportedGradleVersion").equals("true")) { - versions.add(MINIMUM_SUPPORTED_GRADLE_VERSION) - } - if (System.getProperty("testMinimumCurrentGradleVersion").equals("true")) { - versions.add(MINIMUM_GRADLE_6_VERSION) - } - if (System.getProperty("testCurrentGradleVersion").equals("false")) { - versions.remove(CURRENT_GRADLE_VERSION) - } - if (System.getProperty("testSpecificGradleVersion") != "false") { - versions.add(GradleVersion.version(System.getProperty("testSpecificGradleVersion"))) - } - - return versions - } -}