From 6f9c6f675939bc0a3af28ffd9f6cf2b20757bd2e Mon Sep 17 00:00:00 2001 From: Greg Schueler Date: Sat, 26 Sep 2020 16:35:22 -0700 Subject: [PATCH] Fix #331 java 11 illegal access warnings quell warnings caused by Retrofit 2.8 https://github.com/square/retrofit/issues/3341 --- rd-cli-tool/build.gradle | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rd-cli-tool/build.gradle b/rd-cli-tool/build.gradle index f0e5e462..7d3fcfd3 100644 --- a/rd-cli-tool/build.gradle +++ b/rd-cli-tool/build.gradle @@ -64,6 +64,11 @@ dependencies { } shadowJar { mergeServiceFiles() + manifest { + attributes( + ['Add-Opens':'java.base/java.lang.invoke'] + ) + } } //force distZip/distTar artifacts to be overwritten by shadow versions @@ -98,6 +103,14 @@ set -e RD_CONF=${RD_CONF:-$HOME/.$APP_NAME/$APP_NAME.conf} test -f $RD_CONF && . $RD_CONF export RD_EXT_DIR=${RD_EXT_DIR:-$HOME/.$APP_NAME/ext} +''' + ) + def setJ11AddOpens=appendConfigData.curry( + '^APP_ARGS=.*$', + ''' +if $JAVACMD --add-opens 2>&1 | grep 'requires modules' >/dev/null; then + JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" +fi ''' ) @@ -111,9 +124,8 @@ export RD_EXT_DIR=${RD_EXT_DIR:-$HOME/.$APP_NAME/ext} .readLines() .collect(setE) .collect(setClasspath) + .collect(setJ11AddOpens) .join('\n') - - //TODO: modify windows start script to load config } }