Skip to content

Commit 1a19768

Browse files
Gradle 8.9 and minor tweaks
* Update dependency gradle to v8.9 * Replace deprecated GFileUtils * Inline versions * Fix successfully executes benchmark which uses feature previews --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Goooler <[email protected]>
1 parent daef24f commit 1a19768

File tree

8 files changed

+31
-20
lines changed

8 files changed

+31
-20
lines changed

build.gradle.kts

+6-10
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,19 @@ buildScanRecipes {
3030
recipe(mapOf("baseUrl" to "https://github.com/melix/jmh-gradle-plugin/tree"), "git-commit")
3131
}
3232

33-
val jmhVersion: String by project
34-
val spockVersion: String by project
35-
val shadowVersion: String by project
36-
val shadowForkVersion: String by project
37-
val jacocoVersion: String by project
38-
3933
dependencies {
34+
val jmhVersion = "1.37"
4035
implementation("org.openjdk.jmh:jmh-core:$jmhVersion")
4136

42-
testImplementation("org.spockframework:spock-core:$spockVersion") {
37+
testImplementation("org.spockframework:spock-core:2.3-groovy-3.0") {
4338
exclude(mapOf("group" to "org.codehaus.groovy"))
4439
}
45-
pluginsUnderTest("gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion")
46-
pluginsUnderTest("io.github.goooler.shadow:shadow-gradle-plugin:$shadowForkVersion")
40+
pluginsUnderTest("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
41+
pluginsUnderTest("io.github.goooler.shadow:shadow-gradle-plugin:8.1.8")
4742

4843
testImplementation("org.openjdk.jmh:jmh-core:$jmhVersion")
4944
testImplementation("org.openjdk.jmh:jmh-generator-bytecode:$jmhVersion")
45+
testImplementation("commons-io:commons-io:2.16.1")
5046
}
5147

5248
java {
@@ -58,7 +54,7 @@ java {
5854
}
5955

6056
jacoco {
61-
toolVersion = jacocoVersion
57+
toolVersion = "0.8.12"
6258
}
6359

6460
tasks.jacocoTestReport {

gradle.properties

-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ project_website=https://github.com/melix/jmh-gradle-plugin
66
project_issues=https://github.com/melix/jmh-gradle-plugin/issues
77
project_vcs=https://github.com/melix/jmh-gradle-plugin.git
88

9-
jacocoVersion = 0.8.12
10-
jmhVersion = 1.37
11-
shadowVersion = 7.1.2
12-
shadowForkVersion = 8.1.8
13-
spockVersion = 2.3-groovy-3.0
14-
159
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8
1610
org.gradle.parallel=true
1711
org.gradle.caching=true

gradle/wrapper/gradle-wrapper.jar

51 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

src/funcTest/groovy/me/champeau/jmh/AbstractFuncSpec.groovy

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
package me.champeau.jmh
1717

18+
import org.apache.commons.io.FileUtils
1819
import org.gradle.testkit.runner.BuildResult
1920
import org.gradle.testkit.runner.GradleRunner
20-
import org.gradle.util.GFileUtils
2121
import org.gradle.util.GradleVersion
2222
import spock.lang.Specification
2323
import spock.lang.TempDir
@@ -65,13 +65,17 @@ abstract class AbstractFuncSpec extends Specification {
6565
file('build.gradle')
6666
}
6767

68+
File getSettingsFile() {
69+
file('settings.gradle')
70+
}
71+
6872
File getBenchmarksCsv() {
6973
file("build/reports/benchmarks.csv")
7074
}
7175

7276
protected void usingSample(String name) {
7377
File sampleDir = new File("src/funcTest/resources/$name")
74-
GFileUtils.copyDirectory(sampleDir, projectDir)
78+
FileUtils.copyDirectory(sampleDir, projectDir)
7579
}
7680

7781
protected File file(String path) {

src/funcTest/groovy/me/champeau/jmh/ProjectWithFeaturePreviewSpec.groovy

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package me.champeau.jmh
1717

1818
import org.gradle.testkit.runner.TaskOutcome
19+
import org.gradle.util.GradleVersion
1920
import spock.lang.Unroll
2021

2122
@Unroll
@@ -29,6 +30,17 @@ class ProjectWithFeaturePreviewSpec extends AbstractFuncSpec {
2930
given:
3031
usingGradleVersion(gradleVersion)
3132
33+
and:
34+
// TODO: we can move this into the test fixture project once we drop support for Gradle 7.x
35+
if (gradleVersion >= GradleVersion.version("8.9")) {
36+
settingsFile.text =
37+
"""
38+
plugins {
39+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
40+
}\n
41+
""" + settingsFile.text
42+
}
43+
3244
when:
3345
def result = build("jmh")
3446

0 commit comments

Comments
 (0)