Skip to content

Commit

Permalink
Merge pull request #111 from gradlex-org/gradle-version-compatibility
Browse files Browse the repository at this point in the history
Fix compatibility with older Gradle versions
  • Loading branch information
jjohannes authored Jun 4, 2024
2 parents 522eb7e + c6cbb1e commit 075ffd7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
21 changes: 21 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,24 @@ tasks.test {
maxParallelForks = 4
inputs.dir(layout.projectDirectory.dir("samples"))
}

testing.suites.named<JvmTestSuite>("test") {
useJUnitJupiter()
listOf("7.4", "7.6.4", "8.0.2").forEach { gradleVersionUnderTest ->
targets.register("test${gradleVersionUnderTest}") {
testTask {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Runs tests against Gradle $gradleVersionUnderTest"
systemProperty("gradleVersionUnderTest", gradleVersionUnderTest)
exclude("**/*SamplesTest.class") // Not yet cross-version ready
}
}
}
targets.all {
testTask {
maxParallelForks = 4
inputs.dir(layout.projectDirectory.dir("samples"))
inputs.dir("samples")
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.gradlex.javamodule.dependencies.internal.diagnostics.AsciiModuleDependencyReportRenderer;

import javax.inject.Inject;
import java.util.Collections;
import java.util.Set;

@NonNullApi
Expand Down Expand Up @@ -64,7 +65,7 @@ public void setConfigurations(Set<Configuration> configurations) {

private void configurationsChanged() {
getModulePath().setFrom();
getModuleArtifacts().unset();
getModuleArtifacts().set(Collections.emptyMap());
for (Configuration conf : getConfigurations()) {
getModulePath().from(conf);
getModuleArtifacts().put(conf.getName(), getProviders().provider(() -> conf.getIncoming().getArtifacts()));
Expand Down

0 comments on commit 075ffd7

Please sign in to comment.