diff --git a/groovy-commons-cli-1.3.patch b/groovy-commons-cli-1.3.patch index 0ef65b596bf5bd67df1ea975f6131a8098604861..5ccb758b1316a9c083c256144fc35ddacf3df46b 100644 --- a/groovy-commons-cli-1.3.patch +++ b/groovy-commons-cli-1.3.patch @@ -486,6 +486,29 @@ index fd9765c..db29526 100644 grapeHelp = { int spacesLen = commands.keySet().max {it.length()}.length() + 3 +@@ -326,10 +326,18 @@ if (cmd.hasOption('v')) { + return + } + +- +-cmd.getOptionValues('D')?.each {String prop -> +- def (k, v) = prop.split ('=', 2) as List // array multiple assignment quirk +- System.setProperty(k, v ?: "") ++if (cmd.hasOption('D')) { ++ cmd.getOptionValues('D')?.each {String prop -> ++ while (prop.startsWith("=")) { ++ prop = prop.substring(1, prop.length()); ++ } ++ def (k, v) = prop.split ('=', 2) as List // array multiple assignment quirk ++ if (k.isEmpty() || v.isEmpty()) { ++ println "one system property's name or value is emply, skip." ++ } else { ++ System.setProperty(k, v ?: "") ++ } ++ } + } + + String[] arg = cmd.args diff --git a/src/test/groovy/util/CliBuilderTest.groovy b/src/test/groovy/util/CliBuilderTest.groovy index cbd7bd1..d67de50 100644 --- a/src/test/groovy/util/CliBuilderTest.groovy diff --git a/groovy18-script b/groovy18-script index 150fdbd23ed149b6941090367b2d9772794caee5..1b16b81b5f52b15b6af64975681e83cca7ce5e90 100644 --- a/groovy18-script +++ b/groovy18-script @@ -15,9 +15,11 @@ else fi # Configuration +JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk" +GROOVY_HOME="/usr/share/groovy" SCRIPT_PATH=$0 PROGNAME=$(basename $SCRIPT_PATH) -GROOVY_CONF=/etc/groovy18-starter.conf +#GROOVY_CONF=/etc/groovy18-starter.conf TOOLS_JAR=$JAVA_HOME/lib/tools.jar STARTER_MAIN_CLASS=org.codehaus.groovy.tools.GroovyStarter MAIN_CLASS=$STARTER_MAIN_CLASS @@ -78,6 +80,20 @@ BASE_JARS="$BASE_JARS xstream" BASE_JARS="$BASE_JARS jansi" BASE_JARS="$BASE_JARS gpars/gpars" +BASE_JARS="$BASE_JARS ant/ant-antlr" +BASE_JARS="$BASE_JARS ant/ant" +BASE_JARS="$BASE_JARS ant/ant-launcher" +BASE_JARS="$BASE_JARS extra166y.jar" +BASE_JARS="$BASE_JARS hamcrest/core" +BASE_JARS="$BASE_JARS jansi/jansi.jar" +BASE_JARS="$BASE_JARS beust-jcommander.jar" +BASE_JARS="$BASE_JARS jline/jline.jar" +BASE_JARS="$BASE_JARS multiverse/multiverse-core" +BASE_JARS="$BASE_JARS qdox" +BASE_JARS="$BASE_JARS glassfish-servlet-api" +BASE_JARS="$BASE_JARS testng" +BASE_JARS="$BASE_JARS xpp3" +BASE_JARS="$BASE_JARS xstream/xstream" # Set parameters set_jvm set_classpath $BASE_JARS @@ -85,4 +101,6 @@ set_flags $BASE_FLAGS set_options $BASE_OPTIONS $GROOVY_OPTS # Let's start -run --conf "$GROOVY_CONF" --main "$CLASS" "$@" +export GROOVY_VERSION="1.8" +. ${GROOVY_HOME}/bin/startGroovy +startGroovy "$CLASS" "${@}" diff --git a/groovy18.spec b/groovy18.spec index 123d96acdadd9d9a44f5eef9222eabf3e2fb2340..f4ce6d7ae25d773474bdaf9413f50e6a89f5495b 100644 --- a/groovy18.spec +++ b/groovy18.spec @@ -2,7 +2,7 @@ %global archiver 1_8_9 Name: groovy18 Version: 1.8.9 -Release: 1 +Release: 4 Summary: Dynamic language for the Java Platform License: ASL 2.0 and BSD and EPL and Public Domain and CC-BY URL: http://groovy-lang.org @@ -122,5 +122,14 @@ install -p -m644 %{SOURCE2} \ %license LICENSE.txt LICENSE-2.0.txt NOTICE.txt cpl-v10.txt epl-v10.txt %changelog +* Mon Mar 11 2024 Ge Wang - 1.8.9-4 +- Add command line parser separator recogonition + +* Mon Feb 26 2024 xu_ping <707078654@qq.com> - 1.8.9-3 +- fix help information is consistent due to the singularity of the class method. + +*Tue Feb 20 2024 Ge Wang - 1.8.9-2 +- Replace run with exec + * Sat Aug 15 2020 zhanghua - 1.8.9-1 - Package init