Skip to content

Commit

Permalink
Merge pull request #264 from Goooler/master
Browse files Browse the repository at this point in the history
Use Java 21 on CI and minor updates
  • Loading branch information
melix committed Feb 26, 2024
2 parents 4c3cc4a + 11c58f6 commit e70fb4e
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Expand Up @@ -14,14 +14,14 @@ jobs:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/wrapper-validation-action@v1
java-version: 21
- uses: gradle/wrapper-validation-action@v2
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

- name: Execute Gradle build
run: ./gradlew build
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Expand Up @@ -23,5 +23,5 @@ repositories {
}

dependencies {
implementation("com.gradle.publish:plugin-publish-plugin:1.2.0")
implementation("com.gradle.publish:plugin-publish-plugin:1.2.1")
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Expand Up @@ -17,7 +17,7 @@
plugins {
jacoco
id("me.champeau.buildscan-recipes") version "0.2.3"
id("org.nosphere.apache.rat") version "0.8.0"
id("org.nosphere.apache.rat") version "0.8.1"
id("net.nemerosa.versioning") version "3.0.0"
id("com.github.kt3k.coveralls") version "2.12.2"
id("me.champeau.convention-test")
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Expand Up @@ -6,10 +6,10 @@ project_website=https://github.com/melix/jmh-gradle-plugin
project_issues=https://github.com/melix/jmh-gradle-plugin/issues
project_vcs=https://github.com/melix/jmh-gradle-plugin.git

jacocoVersion = 0.8.10
jacocoVersion = 0.8.11
jmhVersion = 1.37
shadowVersion = 7.1.2
shadowForkVersion = 8.1.3
shadowForkVersion = 8.1.5
spockVersion = 2.3-groovy-3.0

org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions samples/simple-java/groovy-dsl/build.gradle
Expand Up @@ -15,15 +15,15 @@
*/
plugins {
id 'java-library'
id "me.champeau.jmh" version "0.7.1"
id "me.champeau.jmh" version "0.7.2"
}

repositories {
mavenCentral()
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

Expand Down
4 changes: 2 additions & 2 deletions samples/simple-java/kotlin-dsl/build.gradle.kts
Expand Up @@ -15,15 +15,15 @@
*/
plugins {
`java-library`
id("me.champeau.jmh") version "0.7.1"
id("me.champeau.jmh") version "0.7.2"
}

repositories {
mavenCentral()
}

dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}

Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Expand Up @@ -23,8 +23,8 @@ pluginManagement {
}

plugins {
id("com.gradle.enterprise") version "3.14.1"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0"
id("com.gradle.enterprise") version "3.16.2"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

gradleEnterprise {
Expand Down
17 changes: 12 additions & 5 deletions src/funcTest/groovy/me/champeau/jmh/AbstractFuncSpec.groovy
Expand Up @@ -51,6 +51,8 @@ abstract class AbstractFuncSpec extends Specification {
testedGradleVersion = gradleVersion
}

// TODO: We can remove this and fully enable CC in tests once bump the Shadow version to 8.1.1+.
// TODO: But Kotlin test still fails, it was suppressed in 1bab41646df6f47aea84ea3febeeec1c76cd2e79, need to investigate.
protected void withoutConfigurationCache(String reason) {
noConfigurationCacheReason = reason
}
Expand Down Expand Up @@ -83,6 +85,7 @@ abstract class AbstractFuncSpec extends Specification {
.withPluginClasspath()
.withProjectDir(projectDir)
.withArguments(arguments)
.withTestKitDir(testKitDir)
}

protected BuildResult build(String... arguments) {
Expand All @@ -94,13 +97,17 @@ abstract class AbstractFuncSpec extends Specification {
}

private List<String> calculateArguments(String... arguments) {
def gradleVersionWithConfigurationCache = testedGradleVersion >= GradleVersion.version('6.6')
if (gradleVersionWithConfigurationCache && noConfigurationCacheReason) {
println("Configuration cache disabled: $noConfigurationCacheReason")
}
(gradleVersionWithConfigurationCache && !noConfigurationCacheReason
(!noConfigurationCacheReason
? ['--stacktrace',
'--configuration-cache']
: ['--stacktrace']) + (arguments as List)
}

private static File getTestKitDir() {
def gradleUserHome = System.getenv("GRADLE_USER_HOME")
if (!gradleUserHome) {
gradleUserHome = new File(System.getProperty("user.home"), ".gradle").absolutePath
}
return new File(gradleUserHome, "testkit")
}
}
4 changes: 2 additions & 2 deletions src/funcTest/groovy/me/champeau/jmh/ParameterSpec.groovy
Expand Up @@ -42,15 +42,15 @@ class ParameterSpec extends AbstractFuncSpec {
usingSample("java-project")

when:
def result = build("jmhJar", "--configuration-cache")
def result = build("jmhJar")

then:
result.task(":jmhJar").outcome == SUCCESS
result.output.contains("Calculating task graph as no configuration cache is available for tasks: jmhJar") ||
result.output.contains("Calculating task graph as no cached configuration is available for tasks: jmhJar")

when:
result = build("jmhJar", "--configuration-cache")
result = build("jmhJar")

then:
result.task(":jmhJar").outcome == UP_TO_DATE
Expand Down
2 changes: 1 addition & 1 deletion src/funcTest/resources/groovy-project/build.gradle
Expand Up @@ -23,7 +23,7 @@ repositories {
}

dependencies {
implementation 'org.codehaus.groovy:groovy-all:3.0.18'
implementation 'org.codehaus.groovy:groovy-all:3.0.20'
}

jmh {
Expand Down
Expand Up @@ -24,7 +24,7 @@ repositories {

dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.apache.commons:commons-lang3:3.13.0'
testImplementation 'org.apache.commons:commons-lang3:3.14.0'
}

jmh {
Expand Down
2 changes: 1 addition & 1 deletion src/funcTest/resources/kotlin-project/build.gradle
Expand Up @@ -18,7 +18,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22'
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/funcTest/resources/mixed-language-project/build.gradle
Expand Up @@ -23,7 +23,7 @@ repositories {
}

dependencies {
implementation 'org.codehaus.groovy:groovy-all:3.0.18'
implementation 'org.codehaus.groovy:groovy-all:3.0.20'
}

jmh {
Expand Down
Expand Up @@ -24,7 +24,7 @@ repositories {
}

dependencies {
implementation 'org.scala-lang:scala-library:2.13.11'
implementation 'org.scala-lang:scala-library:2.13.13'
}

jmh {
Expand Down
2 changes: 1 addition & 1 deletion src/funcTest/resources/scala-project/build.gradle
Expand Up @@ -23,7 +23,7 @@ repositories {
}

dependencies {
implementation 'org.scala-lang:scala-library:2.13.11'
implementation 'org.scala-lang:scala-library:2.13.13'
}

jmh {
Expand Down
2 changes: 1 addition & 1 deletion src/funcTest/resources/scala-shadow-project/build.gradle
Expand Up @@ -24,7 +24,7 @@ repositories {
}

dependencies {
implementation 'org.scala-lang:scala-library:2.13.11'
implementation 'org.scala-lang:scala-library:2.13.13'
}

jmh {
Expand Down

0 comments on commit e70fb4e

Please sign in to comment.