Refactor common options into @{java.application.options} build variable

This commit is contained in:
Reinhard Pointner 2018-03-16 20:53:13 +07:00
parent 640db994b3
commit 5c3ffa1706
9 changed files with 20 additions and 62 deletions

View File

@ -67,7 +67,7 @@ deb.application.class: net-filebot-Main
deb.application.action.import: filebot -script fn:amc --output "$HOME/Media" --action duplicate -non-strict --log-file "$HOME/Media/amc.log" --def excludeList="$HOME/Media/amc.excludes" unsorted=y music=y artwork=y deb.application.action.import: filebot -script fn:amc --output "$HOME/Media" --action duplicate -non-strict --log-file "$HOME/Media/amc.log" --def excludeList="$HOME/Media/amc.excludes" unsorted=y music=y artwork=y
# Default Java Options # Default Java Options
java.application.options: --illegal-access=permit --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.function=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.nio.file.attribute=ALL-UNNAMED --add-opens=java.base/java.nio.channels=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED java.application.options: -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Djna.nosys=true -Djna.nounpack=true --illegal-access=permit --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.function=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.nio.file.attribute=ALL-UNNAMED --add-opens=java.base/java.nio.channels=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED
# Links # Links
link.help.manpage: https://www.filebot.net/cli.html link.help.manpage: https://www.filebot.net/cli.html

View File

@ -153,7 +153,6 @@
<manifest> <manifest>
<attribute name="Build-Date" value="${tstamp.date}" /> <attribute name="Build-Date" value="${tstamp.date}" />
<attribute name="Build-Revision" value="${revision}" /> <attribute name="Build-Revision" value="${revision}" />
<attribute name="Main-Class" value="${main.class}" />
</manifest> </manifest>
</jar> </jar>
</target> </target>

View File

@ -1,4 +1,7 @@
# FileBot launch4j runtime config # default java options
@{java.application.options}
# deployment options
-Dapplication.dir="%APPDATA%\FileBot" -Dapplication.dir="%APPDATA%\FileBot"
-Dapplication.deployment=appx -Dapplication.deployment=appx
-Dapplication.update=skip -Dapplication.update=skip
@ -6,16 +9,9 @@
# put all temporary files here # put all temporary files here
-Djava.io.tmpdir="%APPDATA%\FileBot\tmp" -Djava.io.tmpdir="%APPDATA%\FileBot\tmp"
# network settings
-Djava.net.useSystemProxies=true
# use Java API move/copy operations # use Java API move/copy operations
-DuseNativeShell=false -DuseNativeShell=false
# use NTFS extended attributes for storing metadata
-DuseExtendedFileAttributes=true
-DuseCreationDate=false
# look for executables in the application folder # look for executables in the application folder
-Dnet.filebot.AcoustID.fpcalc="%EXEDIR%\fpcalc.exe" -Dnet.filebot.AcoustID.fpcalc="%EXEDIR%\fpcalc.exe"
@ -24,10 +20,6 @@
-Djna.boot.library.path="%EXEDIR%" -Djna.boot.library.path="%EXEDIR%"
-Djava.library.path="%EXEDIR%" -Djava.library.path="%EXEDIR%"
# make sure to use the bundled JNA library
-Djna.nosys=true
-Djna.nounpack=true
# disable HW acceleration # disable HW acceleration
-Dsun.java2d.d3d=false -Dsun.java2d.d3d=false
-Dprism.order=sw -Dprism.order=sw
@ -38,9 +30,6 @@
# force Application User Model ID for Windows Store # force Application User Model ID for Windows Store
-Dnet.filebot.AppUserModelID=@{microsoft.application.name} -Dnet.filebot.AppUserModelID=@{microsoft.application.name}
# silence Java 9 illegal reflective access warnings
@{java.application.options}
# support JAVA_OPTS environment variable # support JAVA_OPTS environment variable
%JAVA_OPTS% %JAVA_OPTS%

View File

@ -1,4 +1,7 @@
# FileBot launch4j runtime config # default java options
@{java.application.options}
# deployment options
-Dapplication.dir="%APPDATA%\FileBot" -Dapplication.dir="%APPDATA%\FileBot"
-Dapplication.deployment=appx -Dapplication.deployment=appx
-Dapplication.update=skip -Dapplication.update=skip
@ -6,16 +9,9 @@
# put all temporary files here # put all temporary files here
-Djava.io.tmpdir="%APPDATA%\FileBot\tmp" -Djava.io.tmpdir="%APPDATA%\FileBot\tmp"
# network settings
-Djava.net.useSystemProxies=true
# use Windows Shell for move/copy operations # use Windows Shell for move/copy operations
-DuseNativeShell=true -DuseNativeShell=true
# use NTFS extended attributes for storing metadata
-DuseExtendedFileAttributes=true
-DuseCreationDate=false
# look for executables in the application folder # look for executables in the application folder
-Dnet.filebot.AcoustID.fpcalc="%EXEDIR%\fpcalc.exe" -Dnet.filebot.AcoustID.fpcalc="%EXEDIR%\fpcalc.exe"
@ -24,10 +20,6 @@
-Djna.boot.library.path="%EXEDIR%" -Djna.boot.library.path="%EXEDIR%"
-Djava.library.path="%EXEDIR%" -Djava.library.path="%EXEDIR%"
# make sure to use the bundled JNA library
-Djna.nosys=true
-Djna.nounpack=true
# disable HW acceleration # disable HW acceleration
-Dsun.java2d.d3d=false -Dsun.java2d.d3d=false
-Dprism.order=sw -Dprism.order=sw

View File

@ -3,4 +3,4 @@ APP_EXE=`readlink /usr/local/bin/filebot`
APP_ROOT=`dirname "$APP_EXE"` APP_ROOT=`dirname "$APP_EXE"`
# start filebot # start filebot
/usr/libexec/java_home --failfast --version "9+" --exec java -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Dapple.awt.UIElement=true -Djna.nounpack=true -Dapplication.deployment=cask -Djna.library.path="$APP_ROOT/lib" -Djava.library.path="$APP_ROOT/lib" -Dnet.filebot.AcoustID.fpcalc="$APP_ROOT/lib/fpcalc" $JAVA_OPTS -jar "$APP_ROOT/FileBot.jar" "$@" /usr/libexec/java_home --failfast --version "@{jvm.version}+" --exec java @{java.application.options} -Dapplication.deployment=cask -Djava.awt.headless=true -Dapple.awt.UIElement=true -Djna.library.path="$APP_ROOT/lib" -Djava.library.path="$APP_ROOT/lib" -Dnet.filebot.AcoustID.fpcalc="$APP_ROOT/lib/fpcalc" $JAVA_OPTS -classpath "$APP_ROOT/*" @{main.class} "$@"

View File

@ -6,14 +6,7 @@ if [ -z "$HOME" ]; then
exit 1 exit 1
fi fi
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
fi
# select application data folder # select application data folder
APP_DATA="$HOME/.filebot" APP_DATA="$HOME/.filebot"
java -Dunixfs=false -DuseGVFS=true -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Djna.nosys=false -Djna.nounpack=true -Dapplication.deployment=deb -Dnet.filebot.gio.GVFS="$XDG_RUNTIME_DIR/gvfs" -Dapplication.dir="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/temp" -Dnet.filebot.AcoustID.fpcalc="$APP_ROOT/fpcalc" $JAVA_OPTS -jar "$APP_ROOT/FileBot.jar" "$@" java @{java.application.options} -Dapplication.deployment=deb -DuseGVFS=true -Dnet.filebot.gio.GVFS="$XDG_RUNTIME_DIR/gvfs" -Dapplication.dir="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/tmp" -Djna.library.path="$APP_ROOT" -Djava.library.path="$APP_ROOT" -Dnet.filebot.AcoustID.fpcalc="$APP_ROOT/fpcalc" $JAVA_OPTS -classpath "$APP_ROOT/*" @{main.class} "$@"

View File

@ -32,13 +32,6 @@ fi
export LANG="en_US.UTF-8" export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
# add APP_ROOT and PACKAGE_LIBRARY_PATH to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$APP_ROOT:$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$APP_ROOT:$PACKAGE_LIBRARY_PATH"
fi
# choose extractor # choose extractor
EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
# EXTRACTOR="SevenZipExecutable" # use the 7z executable # EXTRACTOR="SevenZipExecutable" # use the 7z executable
@ -48,4 +41,4 @@ EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
APP_DATA="$APP_ROOT/data" APP_DATA="$APP_ROOT/data"
# start filebot # start filebot
java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=false -Dapplication.deployment=portable -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Djna.nosys=false -Djna.nounpack=true -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Dnet.filebot.AcoustID.fpcalc="fpcalc" -Dapplication.dir="$APP_DATA" -Duser.home="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/tmp" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" $JAVA_OPTS -jar "$APP_ROOT/FileBot.jar" "$@" java @{java.application.options} -Dapplication.deployment=portable -Djava.awt.headless=true -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Djna.library.path="$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH" -Djava.library.path="$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH" -Dnet.filebot.AcoustID.fpcalc="fpcalc" -Dapplication.dir="$APP_DATA" -Duser.home="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/tmp" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" $JAVA_OPTS -classpath "$APP_ROOT/*" @{main.class} "$@"

View File

@ -10,4 +10,4 @@ export APP_DATA="$SNAP_USER_DATA/data"
export APP_CACHE="$SNAP_USER_DATA/cache" export APP_CACHE="$SNAP_USER_DATA/cache"
export APP_PREFS="$SNAP_USER_DATA/prefs" export APP_PREFS="$SNAP_USER_DATA/prefs"
java -Duser.home="$SNAP_USER_DATA" -Dunixfs=false -DuseGVFS=true -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.library.path="$LD_LIBRARY_PATH" -Djna.library.path="$LD_LIBRARY_PATH" -Djna.boot.library.path="$SNAP/usr/lib/filebot/$SNAP_ARCH" -Djna.nosys=true -Djna.nounpack=true -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Djava.net.useSystemProxies=true -Dapplication.update=skip -Dapplication.deployment=snap -Dnet.filebot.UserFiles.fileChooser=JavaFX -Dnet.filebot.gio.GVFS="/run/user/$(id -u)/gvfs" -Dapplication.dir="$APP_DATA" -Dapplication.cache="$APP_CACHE/ehcache.disk.store" -Djava.io.tmpdir="$APP_CACHE/java.io.tmpdir" -Djava.util.prefs.userRoot="$APP_PREFS/user" -Djava.util.prefs.systemRoot="$APP_PREFS/system" -Dnet.filebot.AcoustID.fpcalc="$SNAP/usr/bin/fpcalc" $JAVA_OPTS -cp "$SNAP/usr/lib/filebot/java/*" net.filebot.Main "$@" java @{java.application.options} -Dapplication.deployment=snap -Dapplication.update=skip -Djava.library.path="$LD_LIBRARY_PATH" -Djna.library.path="$LD_LIBRARY_PATH" -Djna.boot.library.path="$SNAP/usr/lib/filebot/$SNAP_ARCH" -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dnet.filebot.UserFiles.fileChooser=JavaFX -DuseGVFS=true -Dnet.filebot.gio.GVFS="/run/user/$(id -u)/gvfs" -Duser.home="$SNAP_USER_DATA" -Dapplication.dir="$APP_DATA" -Dapplication.cache="$APP_CACHE/ehcache.disk.store" -Djava.io.tmpdir="$APP_CACHE/java.io.tmpdir" -Djava.util.prefs.userRoot="$APP_PREFS/user" -Djava.util.prefs.systemRoot="$APP_PREFS/system" -Dnet.filebot.AcoustID.fpcalc="$SNAP/usr/bin/fpcalc" $JAVA_OPTS -classpath "$SNAP/usr/lib/filebot/java/*" @{main.class} "$@"

View File

@ -45,14 +45,6 @@ fi
export LANG="en_US.UTF-8" export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
# add PACKAGE_LIBRARY_PATH to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SYNO_LIBRARY_PATH:$PACKAGE_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$SYNO_LIBRARY_PATH:$PACKAGE_LIBRARY_PATH"
fi
# choose extractor # choose extractor
EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
# EXTRACTOR="SevenZipExecutable" # use the 7z executable # EXTRACTOR="SevenZipExecutable" # use the 7z executable
@ -62,4 +54,4 @@ EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
APP_DATA="$APP_ROOT/data/$USER" APP_DATA="$APP_ROOT/data/$USER"
# start filebot # start filebot
java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Djava.net.useSystemProxies=false -Djna.nosys=false -Djna.nounpack=true -Dapplication.deployment=spk -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Dapplication.dir="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/temp" -Duser.home="$APP_DATA" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" $JAVA_OPTS -jar "$APP_ROOT/FileBot.jar" "$@" java @{java.application.options} -Dapplication.deployment=spk -Djava.awt.headless=true -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Djna.library.path="$SYNO_LIBRARY_PATH:$PACKAGE_LIBRARY_PATH" -Djava.library.path="$SYNO_LIBRARY_PATH:$PACKAGE_LIBRARY_PATH" -Duser.home="$APP_DATA" -Dapplication.dir="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/tmp" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" $JAVA_OPTS -classpath "$APP_ROOT/*" @{main.class} "$@"