2016-05-10 15:07:04 -04:00
|
|
|
#!/bin/bash
|
2015-11-25 10:18:08 -05:00
|
|
|
|
|
|
|
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
# or more contributor license agreements. Licensed under the Elastic License;
|
|
|
|
# you may not use this file except in compliance with the Elastic License.
|
|
|
|
|
|
|
|
CDPATH=""
|
|
|
|
SCRIPT="$0"
|
|
|
|
|
|
|
|
# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path.
|
|
|
|
while [ -h "$SCRIPT" ] ; do
|
|
|
|
ls=`ls -ld "$SCRIPT"`
|
|
|
|
# Drop everything prior to ->
|
|
|
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
|
|
if expr "$link" : '/.*' > /dev/null; then
|
|
|
|
SCRIPT="$link"
|
|
|
|
else
|
|
|
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# determine license home
|
|
|
|
LICENSE_HOME=`dirname "$SCRIPT"`/..
|
|
|
|
|
|
|
|
# make LICENSE_HOME absolute
|
|
|
|
LICENSE_HOME=`cd "$LICENSE_HOME"; pwd`
|
|
|
|
|
|
|
|
# setup classpath
|
|
|
|
LICENSE_CLASSPATH=$LICENSE_CLASSPATH:$LICENSE_HOME/lib/${project.artifactId}-${project.version}-exec.jar:$LICENSE_HOME/lib/*
|
|
|
|
|
|
|
|
if [ -x "$JAVA_HOME/bin/java" ]; then
|
|
|
|
JAVA=$JAVA_HOME/bin/java
|
|
|
|
else
|
|
|
|
JAVA=`which java`
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Parse any long getopt options and put them into properties before calling getopt below
|
|
|
|
# Be dash compatible to make sure running under ubuntu works
|
|
|
|
ARGCOUNT=$#
|
|
|
|
COUNT=0
|
|
|
|
while [ $COUNT -lt $ARGCOUNT ]
|
|
|
|
do
|
|
|
|
case $1 in
|
|
|
|
-D*=*)
|
|
|
|
properties="$properties $1"
|
|
|
|
shift 1; COUNT=$(($COUNT+1))
|
|
|
|
;;
|
|
|
|
-D*)
|
|
|
|
properties="$properties $1=$2"
|
|
|
|
shift ; shift; COUNT=$(($COUNT+2))
|
|
|
|
;;
|
|
|
|
*) set -- "$@" "$1"; shift; COUNT=$(($COUNT+1))
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
exec "$JAVA" $JAVA_OPTS -Xmx64m -Xms16m $properties -cp "$LICENSE_CLASSPATH" -Des.path.home="`pwd`" org.elasticsearch.license.licensor.tools.LicenseGeneratorTool "$@"
|