Skip to content

Commit

Permalink
Remove use of deprecated forUseAtConfigurationTime
Browse files Browse the repository at this point in the history
Drop support for older Gradle 7 versions that needed this method for
compatibility with configuration cache.

Fixes #36.
  • Loading branch information
ajoberstar committed Feb 18, 2024
1 parent 91cdc4b commit dfe4981
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ stutter {
languageVersion.set(JavaLanguageVersion.of(11))
}
gradleVersions {
compatibleRange("7.0")
compatibleRange("7.4.2")
}
}

Expand All @@ -57,7 +57,7 @@ stutter {
languageVersion.set(JavaLanguageVersion.of(17))
}
gradleVersions {
compatibleRange("7.3")
compatibleRange("7.4.2")
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ private void createCompatTestTasks(Project project, StutterExtension stutter, So

private Map<String, Set<GradleVersion>> getLockedVersions(Project project, StutterExtension stutter) {
var lockFile = stutter.getLockFile()
.forUseAtConfigurationTime()
.get()
.getAsFile();

Expand All @@ -116,8 +115,7 @@ private Map<String, Set<GradleVersion>> getLockedVersions(Project project, Stutt
}

var lockFileBytes = project.getProviders().fileContents(stutter.getLockFile())
.getAsBytes()
.forUseAtConfigurationTime();
.getAsBytes();

try (var inputStream = new ByteArrayInputStream(lockFileBytes.get());
var reader = new BufferedReader(new InputStreamReader(inputStream))) {
Expand Down
6 changes: 3 additions & 3 deletions stutter.lockfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DO NOT MODIFY: Generated by Stutter plugin.
java11=7.0.2,7.6.3,8.0.2,8.4
java17=7.3.3,7.6.3,8.0.2,8.4
java21=8.4
java11=7.4.2,7.6.4,8.0.2,8.6
java17=7.4.2,7.6.4,8.0.2,8.6
java21=8.4,8.6

0 comments on commit dfe4981

Please sign in to comment.