Skip to content

Commit

Permalink
Merge pull request #419 from grails/webdriver-binaries-gradle-jdk
Browse files Browse the repository at this point in the history
Back to Gradle 8.10.2, except when using geb-with-webdriver-binaries
  • Loading branch information
jamesfredley authored Nov 1, 2024
2 parents b36d2c6 + 336956d commit 060f525
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
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.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class Scope {
public static final Scope PROFILE = new Scope(Source.MAIN, Collections.singletonList(Phase.PROFILE));
public static final Scope INTEGRATION_TEST_IMPLEMENTATION_TEST_FIXTURES = new Scope(Source.MAIN, Collections.singletonList(Phase.INTEGRATION_TEST_IMPLEMENTATION_TEST_FIXTURES));


@NonNull
private Source source;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
import org.grails.forge.feature.build.gradle.templates.buildSrcBuildGradle;
import org.grails.forge.feature.build.gradle.templates.gradleProperties;
import org.grails.forge.feature.build.gradle.templates.settingsGradle;
import org.grails.forge.feature.build.gradle.templates.gradleWrapperProperties;
import org.grails.forge.options.BuildTool;
import org.grails.forge.options.Options;
import org.grails.forge.template.BinaryTemplate;
import org.grails.forge.template.RockerTemplate;
import org.grails.forge.template.URLTemplate;

import java.util.Set;
import java.util.function.Function;
Expand Down Expand Up @@ -63,7 +63,6 @@ public void apply(GeneratorContext generatorContext) {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

generatorContext.addTemplate("gradleWrapperJar", new BinaryTemplate(WRAPPER_JAR, classLoader.getResource(WRAPPER_JAR)));
generatorContext.addTemplate("gradleWrapperProperties", new URLTemplate(WRAPPER_PROPS, classLoader.getResource(WRAPPER_PROPS)));
generatorContext.addTemplate("gradleWrapper", new BinaryTemplate("gradlew", classLoader.getResource("gradle/gradlew"), true));
generatorContext.addTemplate("gradleWrapperBat", new BinaryTemplate("gradlew.bat", classLoader.getResource("gradle/gradlew.bat"), false));

Expand Down Expand Up @@ -96,6 +95,8 @@ public void apply(GeneratorContext generatorContext) {
generatorContext.addTemplate("projectProperties", new RockerTemplate("gradle.properties", gradleProperties.template(generatorContext.getBuildProperties().getProperties())));
String settingsFile = "settings.gradle";
generatorContext.addTemplate("gradleSettings", new RockerTemplate(settingsFile, settingsGradle.template(generatorContext.getProject(), build, coordinateResolver, generatorContext.getFeatures())));

generatorContext.addTemplate("gradleWrapperProperties", new RockerTemplate(WRAPPER_PROPS, gradleWrapperProperties.template(generatorContext.getProject(), build, coordinateResolver, generatorContext.getFeatures())));
}

private void configureDefaultGradleProps(GeneratorContext generatorContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@import org.grails.forge.feature.Features
@import org.grails.forge.options.TestFramework
@import org.grails.forge.util.VersionInfo
@import org.grails.forge.options.JdkVersion

@args (
ApplicationType applicationType,
Expand Down Expand Up @@ -55,8 +56,15 @@ application {

}

@if(features.contains("geb-with-webdriver-binaries")) {
// geb-with-webdriver-binaries is limited to Gradle 8.6 with max JDK 21
compileJava.options.release = @JdkVersion.valueOf(Math.min(features.javaVersion().majorVersion(), JdkVersion.JDK_21.majorVersion())).majorVersion()

} else {
compileJava.options.release = @features.getTargetJdk()

}

@if (features.contains("jrebel")) {
run {
dependsOn(generateRebel)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@import java.util.function.Function
@import org.grails.forge.application.Project
@import org.grails.forge.build.dependencies.CoordinateResolver
@import org.grails.forge.build.dependencies.Coordinate
@import org.grails.forge.build.gradle.GradleBuild
@import org.grails.forge.build.gradle.GradlePlugin
@import org.grails.forge.feature.Features

@args (
Project project,
GradleBuild gradleBuild,
Function<String, Coordinate> coordinateResolver,
Features features)

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
@if(features.contains("geb-with-webdriver-binaries")) {
# geb-with-webdriver-binaries is limited to Gradle 8.6
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
} else {
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
}
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This file was deleted.

0 comments on commit 060f525

Please sign in to comment.