Skip to content

Commit

Permalink
Converted to new submodule-less Gradle build
Browse files Browse the repository at this point in the history
  • Loading branch information
habuma committed Apr 12, 2012
1 parent 8e96d46 commit 40082be
Show file tree
Hide file tree
Showing 104 changed files with 181 additions and 207 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

28 changes: 0 additions & 28 deletions build.gradle
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.springframework.build.Version

// -----------------------------------------------------------------------------
// Main gradle build file for Spring Social LinkedIn
Expand All @@ -30,10 +29,6 @@ abbreviation = 'SOCIAL-LINKEDIN'
apply plugin: 'base'
apply plugin: 'idea'

def buildSrcDir = "$rootDir/buildSrc"
apply from: "$buildSrcDir/wrapper.gradle"
apply from: "$buildSrcDir/maven-root-pom.gradle"

// -----------------------------------------------------------------------------
// Configuration for all projects including this one (the root project)
//
Expand All @@ -43,13 +38,6 @@ allprojects {
// group will translate to groupId during pom generation and deployment
group = 'org.springframework.social'

// version will be used in maven pom generation as well as determining
// where artifacts should be deployed, based on release type of snapshot,
// milestone or release.
// @see org.springframework.build.Version under buildSrc/ for more info
// @see gradle.properties for the declaration of this property.
version = new Version(springSocialLinkedInVersion)

// default set of maven repositories to be used when resolving dependencies
repositories {
mavenRepo urls: 'http://maven.springframework.org/release'
Expand Down Expand Up @@ -87,12 +75,6 @@ configure(javaprojects) {
libsBinDir = new File(libsDir, 'bin')
libsSrcDir = new File(libsDir, 'src')

// add tasks for creating source jars and generating poms etc
apply from: "$buildSrcDir/maven-deployment.gradle"

// add tasks for finding and publishing .xsd files
apply from: "$buildSrcDir/schema-publication.gradle"

springSocialVersion = '1.0.2.RELEASE'
jacksonVersion = '1.9.3'
junitVersion = '4.10'
Expand Down Expand Up @@ -143,13 +125,3 @@ project('spring-social-linkedin') {
testCompile "org.springframework.security:spring-security-crypto:$springSecurityVersion"
}
}

// -----------------------------------------------------------------------------
// Configuration for the docs subproject
// -----------------------------------------------------------------------------
project('docs') {
apply from: "$buildSrcDir/docs.gradle"
}

apply from: "$buildSrcDir/dist.gradle"
apply from: "$buildSrcDir/checks.gradle"
1 change: 0 additions & 1 deletion buildSrc
Submodule buildSrc deleted from db4431
43 changes: 1 addition & 42 deletions gradle.properties
@@ -1,42 +1 @@
# Copyright 2002-2010 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# ------------------------------------------------------------------------------
# version to be applied to all projects in this multi-project build. this is
# the one and only location version changes need to be made.
# ------------------------------------------------------------------------------
springSocialLinkedInVersion=1.0.0.BUILD-SNAPSHOT

# ------------------------------------------------------------------------------
# build system user roles
# role may be either 'developer' or 'buildmaster'
# ------------------------------------------------------------------------------
role=developer

# ------------------------------------------------------------------------------
# for buildmasters: create a $HOME/.gradle/gradle.properties with the following
# properties. They'll be necessary uploading artifacts to s3, maven repos, and
# static.springframework.org. By placing them in your home directory, there's
# no need to change/check in this file. Remember that properties can also be
# specified at the gradle command line with -P, e.g.: -Prole=buildmaster
# ------------------------------------------------------------------------------
# role = buildmaster # overrides default 'role = developer' above
# s3AccessKey=<springsource s3 access key>
# s3SecretAccessKey=<springsource s3 secret access key>
# docsHost=static.springsource.org
# sshHost=static.springsource.org
# sshUsername=<your user id>
# sshPrivateKey=<path to your ssh private key used for logging into sshHost
# mavenSyncRepoDir=<path to sourceforge cvs checkout for maven central sync>
version = 1.0.0.BUILD-SNAPSHOT
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
#Thu Feb 23 13:43:17 CET 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-milestone-8a-bin.zip
145 changes: 81 additions & 64 deletions gradlew
@@ -1,27 +1,35 @@
#!/bin/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
# ADDED BY HAND -- DO NOT ACCIDENTALLY DELETE WHEN UPGRADING GRADLE WRAPPER!
GRADLE_OPTS="-XX:MaxPermSize=1024m -Xmx1024m $GRADLE_OPTS"
# END ADDED BY HAND

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,62 +46,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"`/buildSrc/wrapper/gradle-wrapper.jar
WRAPPER_PROPERTIES=`dirname "$0"`/buildSrc/wrapper/gradle-wrapper.properties
# 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 businessSystem 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
JAVA_OPTS="$JAVA_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 All @@ -120,7 +143,7 @@ if $cygwin ; then
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
Expand All @@ -135,17 +158,11 @@ if $cygwin ; then
esac
fi

GRADLE_APP_BASE_NAME=`basename "$0"`

"$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
-classpath "$CLASSPATH" \
-Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \
-Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \
$STARTER_MAIN_CLASS \
"$@"

RETCODE=$?
# 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"

if [ "$RETCODE" == "1" ] ; then
echo "Gradle classes not found -- did you forget to clone --recursive when checking out this repository? See README for more details"
fi
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

0 comments on commit 40082be

Please sign in to comment.