diff options
author | Andrei Belov <defan@nginx.com> | 2019-03-01 18:30:09 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2019-03-01 18:30:09 +0300 |
commit | 3c3720cba7154bc168cbd00c74817626bb53e140 (patch) | |
tree | da1500f7c6bd5e90ecf45299b6f4b19a29d521cd /auto/modules/java_get_jar | |
parent | 315a864c27aa27a48c013c4a1ef67a099ffea894 (diff) | |
parent | df02b03824065389c73213b19736140442cf63bc (diff) | |
download | unit-3c3720cba7154bc168cbd00c74817626bb53e140.tar.gz unit-3c3720cba7154bc168cbd00c74817626bb53e140.tar.bz2 |
Merged with the default branch.
Diffstat (limited to 'auto/modules/java_get_jar')
-rw-r--r-- | auto/modules/java_get_jar | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/auto/modules/java_get_jar b/auto/modules/java_get_jar new file mode 100644 index 00000000..c61d0a53 --- /dev/null +++ b/auto/modules/java_get_jar @@ -0,0 +1,33 @@ + +# Copyright (C) NGINX, Inc. + +# NXT_JAR_NAME= +# NXT_JAR_VERSION= +# NXT_JAR_NAMESPACE= +# NXT_JAR_REPO=http://central.maven.org/maven2/ +# NXT_JAR_LOCAL_REPO=$HOME/.m2/repository/ + +NXT_JAR_FILE=${NXT_JAR_NAME}-${NXT_JAR_VERSION}.jar +NXT_JAR_LOCAL="${NXT_JAR_LOCAL_REPO}${NXT_JAR_NAMESPACE}${NXT_JAR_NAME}/${NXT_JAR_VERSION}/${NXT_JAR_FILE}" +NXT_JAR_URL=${NXT_JAR_REPO}${NXT_JAR_NAMESPACE}${NXT_JAR_NAME}/${NXT_JAR_VERSION}/${NXT_JAR_FILE} + +if [ ! -f "$NXT_BUILD_DIR/$NXT_JAR_FILE" ]; then + if [ ! -f "$NXT_JAR_LOCAL" ]; then + $echo "getting remote $NXT_JAR_FILE ... " + $echo "getting remote $NXT_JAR_FILE ..." >> $NXT_AUTOCONF_ERR + + mkdir -p "${NXT_JAR_LOCAL_REPO}${NXT_JAR_NAMESPACE}${NXT_JAR_NAME}/${NXT_JAR_VERSION}/" + curl --progress-bar "$NXT_JAR_URL" -o "$NXT_JAR_LOCAL" + else + $echo "getting local $NXT_JAR_FILE" + $echo "getting local $NXT_JAR_FILE ..." >> $NXT_AUTOCONF_ERR + fi + + cp "$NXT_JAR_LOCAL" "$NXT_BUILD_DIR/$NXT_JAR_FILE" +fi + +NXT_JAVA_BUILD_CP="${NXT_JAVA_BUILD_CP}:$NXT_BUILD_DIR/$NXT_JAR_FILE" +NXT_JAVA_INSTALL_JARS="$NXT_JAVA_INSTALL_JARS $NXT_BUILD_DIR/$NXT_JAR_FILE" +NXT_JAVA_UNINSTALL_JARS="$NXT_JAVA_UNINSTALL_JARS \$(DESTDIR)$NXT_JARS/$NXT_JAR_FILE" + +$echo " \"$NXT_JAR_FILE\"," >> $NXT_JAVA_JARS |