updte to OpenJDK 21, Gradle 8.5

This commit is contained in:
Jörg Prante 2024-01-08 00:38:42 +01:00
parent 553c397856
commit 74c0cf6f65
26 changed files with 159 additions and 63 deletions

View file

@ -3,7 +3,7 @@ group = 'org.xbib.gradle.plugin'
wrapper { wrapper {
gradleVersion = libs.versions.gradle.get() gradleVersion = libs.versions.gradle.get()
distributionType = Wrapper.DistributionType.ALL distributionType = Wrapper.DistributionType.BIN
} }
ext { ext {
@ -20,11 +20,3 @@ ext {
licenseName = 'The Apache License, Version 2.0' licenseName = 'The Apache License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
} }
subprojects {
apply plugin: 'java-library'
apply from: rootProject.file('gradle/ide/idea.gradle')
apply from: rootProject.file('gradle/compile/java.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle')
apply from: rootProject.file('gradle/repositories/maven.gradle')
}

View file

@ -1,21 +1,24 @@
plugins { plugins {
id 'java-gradle-plugin'
alias(libs.plugins.publish) alias(libs.plugins.publish)
} }
apply plugin: 'java-gradle-plugin'
apply plugin: 'com.gradle.plugin-publish' apply plugin: 'com.gradle.plugin-publish'
apply from: rootProject.file('gradle/compile/groovy.gradle') apply from: rootProject.file('gradle/compile/groovy.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle')
dependencies { dependencies {
api gradleApi()
implementation libs.asciidoctorj implementation libs.asciidoctorj
implementation libs.jruby implementation libs.jruby
testImplementation libs.spock.core implementation libs.asm
testImplementation libs.jsoup implementation libs.asm.commons
implementation libs.asm.util
testImplementation platform(testLibs.spock.bom)
testImplementation testLibs.spock.core
testImplementation testLibs.jsoup
} }
/*
if (project.hasProperty('gradle.publish.key')) { if (project.hasProperty('gradle.publish.key')) {
gradlePlugin { gradlePlugin {
website = 'https://xbib.org/joerg/gradle-plugins/src/branch/main/gradle-plugin-asciidoctor' website = 'https://xbib.org/joerg/gradle-plugins/src/branch/main/gradle-plugin-asciidoctor'
@ -32,3 +35,4 @@ if (project.hasProperty('gradle.publish.key')) {
} }
} }
} }
*/

View file

@ -1,2 +1,2 @@
name = gradle-plugin-asciidoctor name = gradle-plugin-asciidoctor
version = 3.0.2 version = 3.1.0

View file

@ -21,7 +21,7 @@ class AsciidoctorPlugin implements Plugin<Project> {
AsciidoctorExtension extension = project.extensions.create(ASCIIDOCTORJ, AsciidoctorExtension, project) AsciidoctorExtension extension = project.extensions.create(ASCIIDOCTORJ, AsciidoctorExtension, project)
project.afterEvaluate { project.afterEvaluate {
if(project.extensions.asciidoctorj.addDefaultRepositories) { if (project.extensions.asciidoctorj.addDefaultRepositories) {
project.repositories { project.repositories {
mavenCentral() mavenCentral()
} }

View file

@ -174,5 +174,7 @@ class AsciidoctorExtensions {
) )
new GroovyShell(new Binding(), config) new GroovyShell(new Binding(), config)
} }
} }

View file

@ -1,12 +1,11 @@
plugins { plugins {
id 'java-gradle-plugin'
alias(libs.plugins.publish) alias(libs.plugins.publish)
} }
apply plugin: 'java-gradle-plugin'
apply plugin: 'com.gradle.plugin-publish' apply plugin: 'com.gradle.plugin-publish'
apply from: rootProject.file('gradle/compile/groovy.gradle') apply from: rootProject.file('gradle/compile/groovy.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle')
dependencies { dependencies {
api gradleApi() api gradleApi()

View file

@ -1,2 +1,2 @@
name = gradle-plugin-docker name = gradle-plugin-docker
version = 3.0.2 version = 3.1.0

View file

@ -7,12 +7,13 @@ apply plugin: 'java-gradle-plugin'
apply plugin: 'com.gradle.plugin-publish' apply plugin: 'com.gradle.plugin-publish'
apply from: rootProject.file('gradle/compile/groovy.gradle') apply from: rootProject.file('gradle/compile/groovy.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle')
dependencies { dependencies {
api gradleApi() api gradleApi()
api libs.groovy.git api libs.groovy.git
testImplementation gradleTestKit() testImplementation gradleTestKit()
testImplementation libs.spock.core testImplementation testLibs.spock.core
testImplementation testLibs.junit4 testImplementation testLibs.junit4
} }

View file

@ -1,2 +1,2 @@
name = gradle-plugin-docker name = gradle-plugin-docker
version = 3.0.2 version = 3.1.0

View file

@ -1,2 +1,2 @@
name = gradle-plugin-jacc name = gradle-plugin-jacc
version = 3.0.2 version = 3.1.0

View file

@ -1,2 +1,2 @@
name = gradle-plugin-jflex name = gradle-plugin-jflex
version = 3.0.2 version = 3.1.0

View file

@ -7,6 +7,7 @@ apply plugin: 'java-gradle-plugin'
apply plugin: 'com.gradle.plugin-publish' apply plugin: 'com.gradle.plugin-publish'
apply from: rootProject.file('gradle/compile/groovy.gradle') apply from: rootProject.file('gradle/compile/groovy.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle')
dependencies { dependencies {
api gradleApi() api gradleApi()

View file

@ -1,2 +1,2 @@
name = gradle-plugin-rpm name = gradle-plugin-rpm
version = 3.0.3 version = 3.1.0

View file

@ -15,8 +15,8 @@ dependencies {
implementation libs.asm.commons implementation libs.asm.commons
implementation libs.asm.util implementation libs.asm.util
testImplementation gradleTestKit() testImplementation gradleTestKit()
testImplementation libs.spock.core testImplementation testLibs.spock.core
testImplementation libs.spock.junit4 testImplementation testLibs.spock.junit4
} }
if (project.hasProperty('gradle.publish.key')) { if (project.hasProperty('gradle.publish.key')) {

View file

@ -1,2 +1,2 @@
name = gradle-plugin-shadow name = gradle-plugin-shadow
version = 3.0.2 version = 3.1.0

View file

@ -62,6 +62,8 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField {
} }
/** /**
* Get the CRC32 name.
*
* @return The CRC32 checksum of the filename or comment as * @return The CRC32 checksum of the filename or comment as
* encoded in the central directory of the zip file. * encoded in the central directory of the zip file.
*/ */
@ -70,6 +72,8 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField {
} }
/** /**
* Set teh CRC32 name.
*
* @param nameCRC32 The CRC32 checksum of the filename as encoded * @param nameCRC32 The CRC32 checksum of the filename as encoded
* in the central directory of the zip file to set. * in the central directory of the zip file to set.
*/ */
@ -79,6 +83,8 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField {
} }
/** /**
* Get the Unicode name.
*
* @return The utf-8 encoded name. * @return The utf-8 encoded name.
*/ */
public byte[] getUnicodeName() { public byte[] getUnicodeName() {
@ -91,6 +97,8 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField {
} }
/** /**
* Set the Unicode name.
*
* @param unicodeName The utf-8 encoded name to set. * @param unicodeName The utf-8 encoded name to set.
*/ */
public void setUnicodeName(final byte[] unicodeName) { public void setUnicodeName(final byte[] unicodeName) {

View file

@ -24,6 +24,7 @@ class DependencyUtilsTest {
"java.lang.Object", "java.lang.Object",
"java.lang.String", "java.lang.String",
"java.lang.StringBuilder", "java.lang.StringBuilder",
"java.lang.Thread",
"java.lang.Throwable") "java.lang.Throwable")
.sort() .sort()
// we do not care about jdk.internal classes, they vary between JDK versions and even JVMs // we do not care about jdk.internal classes, they vary between JDK versions and even JVMs

View file

@ -1,5 +1,5 @@
group = org.xbib.gradle.plugin group = org.xbib.gradle.plugin
name = gradle-plugins name = gradle-plugins
version = 0.0.6
org.gradle.warning.mode = ALL # version reflects gradle version plus a patch level version
version = 8.5.0

View file

@ -0,0 +1,30 @@
apply plugin: 'groovy'
// no groovy dependencies, we must use gradle embedded groovy
compileGroovy {
groovyOptions.configurationScript = rootProject.file('gradle/compile/groovyc.groovy')
}
compileTestGroovy {
}
tasks.withType(GroovyCompile) {
options.forkOptions.jvmArgs.add('-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true')
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs << '-proc:none'
}
}
task groovydocJar(type: Jar, dependsOn: 'groovydoc') {
from groovydoc.destinationDir
archiveClassifier.set('javadoc')
}
// make java source visible to groovy compiler, suppress sources for java compiler
sourceSets {
main {
java { srcDirs = [] }
groovy { srcDirs += ['src/main/java'] }
}
}

View file

@ -0,0 +1,39 @@
apply plugin: 'groovy'
// no groovy dependencies, we must use gradle embedded groovy
compileGroovy {
// type checked, static
groovyOptions.configurationScript = rootProject.file('gradle/compile/groovyc.groovy')
}
compileTestGroovy {
// type checked, static
groovyOptions.configurationScript = rootProject.file('gradle/compile/groovyc.groovy')
}
tasks.withType(GroovyCompile) {
options.forkOptions.jvmArgs.add('-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true')
options.compilerArgs
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs.add('-proc:none')
}
}
task groovydocJar(type: Jar) {
dependsOn groovydoc
from groovydoc.destinationDir
archiveClassifier.set('groovydoc')
}
tasks.assemble.dependsOn(tasks.groovydocJar)
artifacts {
archives groovydocJar
}
// make java source visible to groovy compiler, suppress sources for java compiler
sourceSets {
main {
java { srcDirs = [] }
groovy { srcDirs += ['src/main/java'] }
}
}

View file

@ -1,33 +1,37 @@
apply plugin: 'groovy' apply plugin: 'groovy'
dependencies { // no groovy dependencies, we must use gradle embedded groovy
implementation libs.groovy.core
compileGroovy {
} }
java { compileTestGroovy {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
modularity.inferModulePath.set(true)
withSourcesJar()
withJavadocJar()
} }
tasks.withType(GroovyCompile) { tasks.withType(GroovyCompile) {
options.compilerArgs
if (!options.compilerArgs.contains("-processor")) { if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs.add('-proc:none') options.compilerArgs.add('-proc:none')
} }
} }
/* task groovydocJar(type: Jar, dependsOn: 'groovydoc') {
https://github.com/gradle/gradle/issues/15283
task groovydocJar(type: Jar) {
dependsOn groovydoc
from groovydoc.destinationDir from groovydoc.destinationDir
archiveClassifier.set('groovydoc') archiveClassifier.set('groovydoc')
} }
tasks.assemble.dependsOn(tasks.groovydocJar)
*/ artifacts {
archives groovydocJar
}
// make java source visible to groovy compiler, suppress sources for java compiler
sourceSets {
main {
java { srcDirs = [] }
groovy { srcDirs += ['src/main/java'] }
}
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
}

View file

@ -0,0 +1,7 @@
import groovy.transform.TypeChecked
import groovy.transform.CompileStatic
withConfig(configuration) {
ast(TypeChecked)
ast(CompileStatic)
}

View file

@ -3,7 +3,7 @@ apply plugin: 'java-library'
java { java {
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(17) languageVersion = JavaLanguageVersion.of(21)
} }
modularity.inferModulePath.set(true) modularity.inferModulePath.set(true)
withSourcesJar() withSourcesJar()
@ -13,6 +13,7 @@ java {
jar { jar {
manifest { manifest {
attributes('Implementation-Version': project.version) attributes('Implementation-Version': project.version)
attributes('X-Java-Compiler-Version': JavaLanguageVersion.of(21).toString())
} }
} }

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -2,34 +2,41 @@
dependencyResolutionManagement { dependencyResolutionManagement {
versionCatalogs { versionCatalogs {
libs { libs {
version('gradle', '8.4') version('gradle', '8.5')
version('groovy', '3.0.17') version('groovy', '3.0.17') // MUST match gradle groovy version
version('spock', '2.0-groovy-3.0')
version('asm', '9.6') version('asm', '9.6')
library('groovy-core', 'org.codehaus.groovy', 'groovy').versionRef('groovy') // Attention: it is impossible to develop a gradle plugin with groovy 4!
library('spock-core', 'org.spockframework', 'spock-core').versionRef('spock') // The gradle plugin publish plugin enforces java-gradle-plugin,
library('spock-junit4', 'org.spockframework', 'spock-junit4').versionRef('spock') // and java-gradle-plugin enforces the embedded groovy of gradle on the compile classpath.
// we keep this here as reference when Gradle switsches to Groovy 4+
//library('groovy-bom', 'org.apache.groovy', 'groovy-bom').versionRef('groovy')
//library('groovy', 'org.apache.groovy', 'groovy').versionRef('groovy')
library('asm', 'org.ow2.asm', 'asm').versionRef('asm') library('asm', 'org.ow2.asm', 'asm').versionRef('asm')
library('asm-commons', 'org.ow2.asm', 'asm-commons').versionRef('asm') library('asm-commons', 'org.ow2.asm', 'asm-commons').versionRef('asm')
library('asm-util', 'org.ow2.asm', 'asm-util').versionRef('asm') library('asm-util', 'org.ow2.asm', 'asm-util').versionRef('asm')
library('asciidoctorj', 'org.asciidoctor', 'asciidoctorj').version('2.5.8') library('asciidoctorj', 'org.asciidoctor', 'asciidoctorj').version('2.5.11')
library('jruby', 'org.jruby', 'jruby').version('9.4.2.0') library('jruby', 'org.jruby', 'jruby').version('9.4.5.0')
library('jsoup', 'org.jsoup', 'jsoup').version('1.16.1')
library('jflex', 'de.jflex', 'jflex').version('1.9.1') library('jflex', 'de.jflex', 'jflex').version('1.9.1')
library('jacc', 'org.xbib', 'jacc').version('3.0.0') library('jacc', 'org.xbib', 'jacc').version('3.0.0')
library('groovy-git', 'org.xbib.groovy', 'groovy-git').version('2.1.0') library('rpm', 'org.xbib', 'rpm-core').version('4.0.0')
library('rpm', 'org.xbib', 'rpm-core').version('3.0.1') // MUST be groovy 3 dependency
library('groovy-git', 'org.xbib.groovy', 'groovy-git').version('3.0.17.0')
plugin('publish', 'com.gradle.plugin-publish').version('1.2.1') plugin('publish', 'com.gradle.plugin-publish').version('1.2.1')
} }
testLibs { testLibs {
version('junit', '5.10.0') version('junit', '5.10.1')
version('spock', '2.3-groovy-3.0')
library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit') library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')
library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit') library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit')
library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit') library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit')
library('junit-jupiter-vintage', 'org.junit.vintage', 'junit-vintage-engine').versionRef('junit') library('junit-jupiter-vintage', 'org.junit.vintage', 'junit-vintage-engine').versionRef('junit')
library('junit-jupiter-platform-launcher', 'org.junit.platform', 'junit-platform-launcher').version('1.10.0') library('junit-jupiter-platform-launcher', 'org.junit.platform', 'junit-platform-launcher').version('1.10.1')
library('hamcrest', 'org.hamcrest', 'hamcrest-library').version('2.2') library('hamcrest', 'org.hamcrest', 'hamcrest-library').version('2.2')
library('junit4', 'junit', 'junit').version('4.13.2') library('junit4', 'junit', 'junit').version('4.13.2')
library('spock-bom', 'org.spockframework', 'spock-bom').versionRef('spock')
library('spock-core', 'org.spockframework', 'spock-core').versionRef('spock')
library('spock-junit4', 'org.spockframework', 'spock-junit4').versionRef('spock')
library('jsoup', 'org.jsoup', 'jsoup').version('1.17.2')
} }
} }
} }