Allow calling script to pass directory for collecting artifacts.
It's useful for elemental2 that call this script for each elemental2 lib.
+ don't ask for gpg passphrase if we are not deploying the artifacts.
@@ -74,6 +74,9 @@ while [[ "$1" != "" ]]; do
;;
--no-deploy ) deploy_to_sonatype=false
;;
+ --artifact_dir ) shift
+ artifact_directory=$1
+ ;;
* ) echo "Error: Unknown flag $1"
exit 1
;;
@@ -82,7 +85,7 @@ while [[ "$1" != "" ]]; do
done
-if [[ -z ${gpg_passphrase} ]]; then
+if [[ ${deploy_to_sonatype} == true ]] && [[ -z ${gpg_passphrase} ]]; then
# As this script can be called in a for loop for releasing several artifacts at once, the caller
# script can pass the gpg_passphrase as argument to avoid to ask several time the user for the
# passphrase.
@@ -99,7 +102,9 @@ create_artifact() {
classes_directory=$(mktemp -d)
srcs_directory=$(mktemp -d)
javadoc_directory=$(mktemp -d)
+if [[ -z ${artifact_directory} ]]; then
artifact_directory=$(mktemp -d)
+fi
cd ${srcs_directory}
