diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 129a7204..8d5cf44c 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -13,6 +13,12 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co == Unreleased +Build Improvement:: + +* Move to new plugin suite org.ysb33r.jruby for installing ruby gems (#1293) +* Upgrade build to Gradle 8.12 (#1293) + + == 3.0.0 (2024-08-25) Build Improvement:: diff --git a/asciidoctorj-core/build.gradle b/asciidoctorj-core/build.gradle index ed1403e8..6717275d 100644 --- a/asciidoctorj-core/build.gradle +++ b/asciidoctorj-core/build.gradle @@ -1,7 +1,10 @@ apply plugin: 'java-library' apply plugin: 'groovy' apply plugin: 'biz.aQute.bnd.builder' -apply plugin: 'com.github.jruby-gradle.base' +apply plugin: 'org.ysb33r.jruby.base' +apply plugin: 'org.ysb33r.jruby.resolver' + +import org.ysb33r.gradle.jruby.api.base.tasks.JRubyPrepare project.ext.publicationName = "mavenAsciidoctorJ" @@ -12,21 +15,27 @@ repositories { ruby.gems() } +configurations { + runtimeGems { + canBeResolved(true) + } +} + dependencies { api project(':asciidoctorj-api') api "org.jruby:jruby:$jrubyVersion" - gems "rubygems:asciidoctor:$asciidoctorGemVersion" - gems "rubygems:asciimath:$asciimathGemVersion" - gems "rubygems:coderay:$coderayGemVersion" - gems "rubygems:rouge:$rougeGemVersion" - gems "rubygems:erubis:$erubisGemVersion" - gems "rubygems:haml:$hamlGemVersion" - gems "rubygems:open-uri-cached:$openUriCachedGemVersion" - gems "rubygems:slim:$slimGemVersion" - gems "rubygems:thread_safe:$threadSafeGemVersion" - gems "rubygems:tilt:$tiltGemVersion" - gems "rubygems:concurrent-ruby:$concurrentRubyGemVersion" + runtimeGems "rubygems:asciidoctor:$asciidoctorGemVersion" + runtimeGems "rubygems:asciimath:$asciimathGemVersion" + runtimeGems "rubygems:coderay:$coderayGemVersion" + runtimeGems "rubygems:rouge:$rougeGemVersion" + runtimeGems "rubygems:erubis:$erubisGemVersion" + runtimeGems "rubygems:haml:$hamlGemVersion" + runtimeGems "rubygems:open-uri-cached:$openUriCachedGemVersion" + runtimeGems "rubygems:slim:$slimGemVersion" + runtimeGems "rubygems:thread_safe:$threadSafeGemVersion" + runtimeGems "rubygems:tilt:$tiltGemVersion" + runtimeGems "rubygems:concurrent-ruby:$concurrentRubyGemVersion" // TODO could use dependency replacement feature to fix version of Saxon-HE testImplementation("org.xmlmatchers:xml-matchers:$xmlMatchersVersion") { exclude module: 'Saxon-HE' } testImplementation "net.sf.saxon:Saxon-HE:$saxonVersion" @@ -45,7 +54,8 @@ def gemFiles = fileTree("${project.buildDir}/.gems") { apply from: rootProject.file('gradle/versioncheck.gradle') -jrubyPrepare { +tasks.named('gemPrepare', JRubyPrepare) { + gemConfiguration = configurations.runtimeGems doLast { copy { // bundles the gems inside this artifact from gemFiles @@ -53,14 +63,8 @@ jrubyPrepare { } } } -tasks.eclipse.dependsOn jrubyPrepare - +tasks.eclipse.dependsOn gemPrepare -jruby { - defaultRepositories = false - jrubyVersion = jrubyVersion - // TODO I'd like to be able to customize the name of the gemInstallDir -} ext { // path to use for the prepared jruby gems @@ -70,14 +74,14 @@ ext { sourceSets { main { //let's register an output folder on the main SourceSet: - output.dir(preparedGems, builtBy: 'jrubyPrepare') + output.dir(preparedGems, builtBy: 'gemPrepare') //it is now a part of the 'main' classpath and will be a part of the jar } } // QUESTION is this the right place to insert this task dependency in the lifecycle? // IMPORTANT The TMP or TEMP environment variable must be set for the gem install command to work on Windows -processResources.dependsOn jrubyPrepare +processResources.dependsOn gemPrepare javadoc { diff --git a/asciidoctorj-wildfly-integration-test/build.gradle b/asciidoctorj-wildfly-integration-test/build.gradle index 97e27f0a..183c3bc5 100644 --- a/asciidoctorj-wildfly-integration-test/build.gradle +++ b/asciidoctorj-wildfly-integration-test/build.gradle @@ -63,7 +63,7 @@ task createModuleDescriptor(type: Copy) { into "build/modules/org/asciidoctor/asciidoctorj/main" filter { it - .replaceAll('@@version@@', project(':asciidoctorj').version) + .replaceAll('@@version@@', project.version) .replaceAll('@@jrubyVersion@@', jrubyVersion) } } diff --git a/build.gradle b/build.gradle index beafe2f8..56300f17 100644 --- a/build.gradle +++ b/build.gradle @@ -18,16 +18,14 @@ buildscript { } dependencies { classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0" - classpath("com.github.jruby-gradle:jruby-gradle-plugin:2.0.1") { - exclude module: 'grolifant' - exclude module: 'okhttp-digest' - } - classpath 'org.ysb33r.gradle:grolifant:0.17.0' } } // modern plugins config plugins { + id 'org.ysb33r.jruby.resolver' version '2.0.0' + id 'org.ysb33r.jruby.base' version '2.0.0' + id "io.sdkman.vendors" version "3.0.0" id "signing" id "io.github.gradle-nexus.publish-plugin" version "1.3.0" diff --git a/gradle.properties b/gradle.properties index 837e566f..8886d080 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=3.0.0 +version=3.0.1-SNAPSHOT org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m diff --git a/gradle/sdkman.gradle b/gradle/sdkman.gradle index af8baeed..436ce822 100644 --- a/gradle/sdkman.gradle +++ b/gradle/sdkman.gradle @@ -4,7 +4,7 @@ sdkman { consumerKey = project.sdkman_consumer_key consumerToken = project.sdkman_consumer_token candidate = rootProject.name - version = rootProject.version + version = project.version hashtag = "#asciidoctorj" url = "https://repo1.maven.org/maven2/org/asciidoctor/asciidoctorj/${rootProject.version}/asciidoctorj-${rootProject.version}-bin.zip" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd491..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e093..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/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.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..f3b75f3b 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..9b42019c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,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 @@ -57,11 +59,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