Skip to content

Commit

Permalink
wrapper to 1.5, using fatJar plugin for uberjar
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaruch committed May 5, 2013
1 parent 753505b commit f403c01
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ BINTRAY_HOME
out
services/src/test/resources/artifactory-client.properties
atlassian-*.xml
.idea/
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16')
classpath(group: 'eu.appsatori', name: 'gradle-fatjar-plugin', version: '0.2-rc1')
}
}

Expand Down Expand Up @@ -55,7 +56,7 @@ allprojects {
maven = true
}
}
}
}

group = 'com.jfrog.artifactory.client'
version = globalVersion
Expand Down Expand Up @@ -86,7 +87,7 @@ subprojects {

test {
useTestNG()
testLogging {
testLogging {
exceptionFormat "full"
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
minGranularity 0
Expand All @@ -96,7 +97,7 @@ subprojects {
}

task wrapper(type: Wrapper) {
gradleVersion = '1.3'
gradleVersion = '1.5'
}

idea {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Dec 02 10:47:14 IST 2012
#Sun May 05 15:00:00 IDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.3-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-1.5-bin.zip
135 changes: 76 additions & 59 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
#!/bin/bash
#!/usr/bin/env bash

##############################################################################
## ##
## Gradle wrapper script for UN*X ##
## ##
##
## Gradle start up script for UN*X
##
##############################################################################

# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
# GRADLE_OPTS="$GRADLE_OPTS -Xmx512m"
# JAVA_OPTS="$JAVA_OPTS -Xmx512m"
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

GRADLE_APP_NAME=Gradle
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
echo "${PROGNAME}: $*"
echo "$*"
}

die ( ) {
warn "$*"
echo
echo "$*"
echo
exit 1
}


# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
Expand All @@ -38,64 +42,77 @@ case "`uname`" in
;;
esac

# Attempt to set JAVA_HOME if it's not already set.
if [ -z "$JAVA_HOME" ] ; then
if $darwin ; then
[ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] && export JAVA_HOME="/Library/Java/Home"
[ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] && export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
else
javaExecutable="`which javac`"
[ -z "$javaExecutable" -o "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ] && die "JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME."
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
[ `expr "$readLink" : '\([^ ]*\)'` = "no" ] && die "JAVA_HOME not set and readlink not available, please set JAVA_HOME."
javaExecutable="`readlink -f \"$javaExecutable\"`"
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
export JAVA_HOME="$javaHome"
fi
fi

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
CLASSPATH=`dirname "$0"`/gradle/wrapper/gradle-wrapper.jar
WRAPPER_PROPERTIES=`dirname "$0"`/gradle/wrapper/gradle-wrapper.properties
REPO_INIT_SCRIPT=`dirname "$0"`/buildSrc/repo-init.gradle
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="java"
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
if [ ! -x "$JAVACMD" ] ; then
die "JAVA_HOME is not defined correctly, can not execute: $JAVACMD"
fi
if [ -z "$JAVA_HOME" ] ; then
warn "JAVA_HOME environment variable is not set"

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME"
# we may also want to set -Xdock:image
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"`
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

# We build the pattern for arguments to be converted via cygpath
Expand Down Expand Up @@ -137,11 +154,11 @@ if $cygwin ; then
esac
fi

GRADLE_APP_BASE_NAME=`basename "$0"`
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

"$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
-classpath "$CLASSPATH" \
-Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \
-Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \
$STARTER_MAIN_CLASS \
"$@"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
13 changes: 5 additions & 8 deletions services/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'groovy'
apply plugin: 'fatjar'

dependencies {
compile project(':api')
Expand All @@ -25,7 +26,7 @@ def addJackson(name) {
[group: 'com.fasterxml.jackson.core', name: name, version: '2.0.4']
}

def addSlf4J(name){
def addSlf4J(name) {
[group: 'org.slf4j', name: name, version: '1.7.2']
}

Expand All @@ -34,15 +35,11 @@ configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
}

task uberJar(type: Jar) {
dependsOn configurations.runtime
from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
classifier = 'uber'
fatJar {
baseName = 'artifactory-client-java'
}

uberJar.dependsOn jar

artifacts {
archives sourceJar, uberJar, jar
archives sourceJar, fatJar, jar
}

0 comments on commit f403c01

Please sign in to comment.