feat: Add option to override output directory

This commit is contained in:
Serge Guzik 2019-02-15 11:36:51 +02:00
parent 4e87231b59
commit 2a3771f0fd
2 changed files with 21 additions and 2 deletions

View File

@ -78,6 +78,10 @@ Options:
override JDK/JRE version override JDK/JRE version
examples: "11", "11.0", "11.0.2", "11.0.2+9" examples: "11", "11.0", "11.0.2", "11.0.2+9"
(default: 11) (default: 11)
-o, --output <directory>
override output directory;
this is relative to current PWD
(default: ./warped)
--no-optimize use JRE instead of optimized JDK; --no-optimize use JRE instead of optimized JDK;
by default jdeps and jlink are used to create by default jdeps and jlink are used to create
optimized JDK for the partiular jar, optimized JDK for the partiular jar,

19
warp4j
View File

@ -11,6 +11,10 @@ function print_help {
echo ' override JDK/JRE version' echo ' override JDK/JRE version'
echo ' examples: "11", "11.0", "11.0.2", "11.0.2+9"' echo ' examples: "11", "11.0", "11.0.2", "11.0.2+9"'
echo ' (default: 11)' echo ' (default: 11)'
echo ' -o, --output <directory>'
echo ' override output directory;'
echo ' this is relative to current PWD'
echo ' (default: ./warped)'
echo ' --no-optimize use JRE instead of optimized JDK;' echo ' --no-optimize use JRE instead of optimized JDK;'
echo ' by default jdeps and jlink are used to create' echo ' by default jdeps and jlink are used to create'
echo ' optimized JDK for the partiular jar,' echo ' optimized JDK for the partiular jar,'
@ -79,6 +83,10 @@ while [[ $# -gt 0 ]]; do
JAVA_VERSION_OVERRIDEN=true JAVA_VERSION_OVERRIDEN=true
shift 2 shift 2
;; ;;
-o|--output)
OUTPUT_DIR_PATH="$2"
shift 2
;;
--no-optimize) --no-optimize)
NO_OPTIMIZE=true NO_OPTIMIZE=true
shift shift
@ -262,8 +270,15 @@ JAVA_DOWNLOAD_PATH=$CACHE_PATH/$JAVA_DISTRO_TYPE/$JVM_IMPL
BUNDLES_PATH=$CACHE_PATH/bundle # prepare bundles here BUNDLES_PATH=$CACHE_PATH/bundle # prepare bundles here
DIR="$(pwd -P)" # execution directory path DIR="$(pwd -P)" # execution directory path
WARPED_PATH=$DIR/warped # final binaries go here
WARPED_TEMP_PATH=$DIR/warped-tmp # final binaries created here then moved to WARPED_PATH # final binaries created in WARPED_TEMP_PATH and then moved to WARPED_PATH
if [[ -z $OUTPUT_DIR_PATH ]]; then
WARPED_PATH=$DIR/warped
WARPED_TEMP_PATH=$DIR/warped/tmp
else
WARPED_PATH=$OUTPUT_DIR_PATH
WARPED_TEMP_PATH=$OUTPUT_DIR_PATH/tmp
fi
BUNDLED_DISTRO_SUBDIR="java" # runtime directory inside a bundle BUNDLED_DISTRO_SUBDIR="java" # runtime directory inside a bundle