Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update asm for Java 19 support #220

Merged
merged 13 commits into from
Dec 24, 2022
64 changes: 24 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ buildscript {
}
}
dependencies {
classpath 'org.kohsuke:github-api:1.133'
classpath 'org.kohsuke:github-api:1.308'
}
}

plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id "com.gradle.plugin-publish" version "0.16.0"
id 'com.github.johnrengelman.shadow' version '7.1.2'
id "com.gradle.plugin-publish" version "1.0.0"
id "com.github.ethankhall.semantic-versioning" version "1.1.0"
id "com.github.ben-manes.versions" version "0.39.0"
id 'com.github.jk1.dependency-license-report' version '1.17'
id "com.github.hierynomus.license" version "0.15.0"
id "com.github.ben-manes.versions" version "0.42.0"
id 'com.github.jk1.dependency-license-report' version '2.1'
id "com.github.hierynomus.license" version "0.16.1"
id "org.asciidoctor.convert" version "2.4.0"
id "org.ajoberstar.git-publish" version "2.1.3"
id "org.ajoberstar.git-publish" version "4.1.1"
}

if(JavaVersion.current() != JavaVersion.VERSION_11) {
throw new GradleException("Please use Java 11 to execute this Gradle build")
if(JavaVersion.current() < JavaVersion.VERSION_11) {
throw new GradleException("Please use at least Java 11 to execute this Gradle build")
}

project.version.with {
Expand All @@ -45,8 +45,6 @@ ext.badassJlinkPluginTag = Boolean.valueOf(badassJlinkPluginReleaseBuild) ? "v$e
group = 'org.beryx'
version = badassJlinkPluginVersion

ext.asmVersion = '9.2'

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -82,38 +80,29 @@ configurations {
}

dependencies {
implementation gradleTestKit()
implementation localGroovy()
implementation gradleApi()
implementation gradleTestKit()

implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.2'

implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.32'

plugin "org.ow2.asm:asm:$asmVersion"
plugin "org.ow2.asm:asm-commons:$asmVersion"
plugin "org.ow2.asm:asm-tree:$asmVersion"
plugin "org.ow2.asm:asm-util:$asmVersion"
plugin "org.ow2.asm:asm-analysis:$asmVersion"

testImplementation('org.spockframework:spock-core:1.1-groovy-2.4') {
testImplementation('org.spockframework:spock-core:2.2-groovy-3.0') {
exclude module: 'groovy-all'
}
testImplementation('org.spockframework:spock-junit4:2.2-groovy-3.0') {
exclude module: 'groovy-all'
}

testImplementation 'cglib:cglib-nodep:3.3.0'
testImplementation 'org.objenesis:objenesis:3.2'
testImplementation ('com.athaydes:spock-reports:1.8.0') { transitive = false}
testImplementation 'org.objenesis:objenesis:3.3'
testImplementation ('com.athaydes:spock-reports:2.3.1-groovy-3.0') { transitive = false}

asciidoctor 'com.bmuschko:asciidoctorj-tabbed-code-extension:0.3'
}

shadowJar {
configurations = [project.configurations.plugin]
archiveClassifier = null
dependencies {
include(dependency("org.ow2.asm:asm:$asmVersion"))
include(dependency("org.ow2.asm:asm-commons:$asmVersion"))
include(dependency("org.ow2.asm:asm-tree:$asmVersion"))
include(dependency("org.ow2.asm:asm-util:$asmVersion"))
include(dependency("org.ow2.asm:asm-anaysis:$asmVersion"))
}
relocate 'org.objectweb.asm', 'org.beryx.jlink.shadow.asm'
}

jar.enabled = false
Expand All @@ -123,25 +112,19 @@ gradlePlugin {
plugins {
jlink {
id = 'org.beryx.jlink'
displayName = 'Badass JLink Plugin'
description = 'A Gradle plugin that assembles your modules into a custom runtime image'
implementationClass = 'org.beryx.jlink.JlinkPlugin'
}
}
}

pluginBundle {
website = 'https://github.com/beryx/badass-jlink-plugin/'
vcsUrl = 'https://github.com/beryx/badass-jlink-plugin'
description = 'A Gradle plugin that assembles your modules into a custom runtime image'
tags = ['jlink', 'jpms', 'image']

plugins {
jlink {
id = 'org.beryx.jlink'
displayName = 'Badass JLink Plugin'
}
}
}


jar {
manifest {
attributes 'Implementation-Title': "${project.archivesBaseName}",
Expand All @@ -153,6 +136,7 @@ test {
testLogging {
exceptionFormat = 'full'
}
useJUnitPlatform()
}

asciidoctor {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
11 changes: 5 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Apr 25 12:16:33 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
111 changes: 68 additions & 43 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

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

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand All @@ -30,6 +64,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,28 +75,14 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand All @@ -85,7 +106,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -105,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand All @@ -134,27 +156,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
Loading