Permalink
Browse files

added build files

  • Loading branch information...
1 parent b682ecf commit fb1333990d5598f9606cbb1cfbb8d89f7182d9b3 Johannes Buehler committed Mar 17, 2012
Showing with 534 additions and 0 deletions.
  1. +36 −0 README
  2. +159 −0 build.gradle
  3. +42 −0 gradle.properties
  4. +151 −0 gradlew
  5. +126 −0 gradlew.bat
  6. +20 −0 settings.gradle
View
36 README
@@ -0,0 +1,36 @@
+================================ Spring Social ===============================
+To check out the project and build from source, do the following:
+
+ git clone --recursive git://github.com/SpringSource/spring-social.git
+ cd spring-social
+ ./gradlew build
+
+Note: the --recursive switch above is important, as spring-social uses
+git submodules, which must themselves be cloned and initialized. If --recursive
+is omitted, doing so becomes a multi-step process of:
+
+git clone git://github.com/SpringSource/spring-social.git
+git submodule init
+git submodule update
+
+-------------------------------------------------------------------------------
+To generate Eclipse metadata (.classpath and .project files), do the following:
+
+ ./gradlew eclipse
+
+Once complete, you may then import the projects into Eclipse as usual:
+
+ File -> Import -> Existing projects into workspace
+
+-------------------------------------------------------------------------------
+To generate IDEA metadata (.iml and .ipr files), do the following:
+
+ ./gradlew idea
+
+-------------------------------------------------------------------------------
+To build the JavaDoc, do the following from within the root directory:
+
+ ./gradlew :docs:api
+
+The result will be available in 'docs/build/api'.
+===============================================================================
View
@@ -0,0 +1,159 @@
+/*
+ * Copyright 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.
+ */
+ import org.springframework.build.Version
+
+// -----------------------------------------------------------------------------
+// Main gradle build file for Spring Social Xing
+// @author Johannes Buehler
+//
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+// Configuration for the root project
+// -----------------------------------------------------------------------------
+description = 'Spring Social Xing'
+abbreviation = 'SOCIAL-XING'
+
+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)
+//
+// @see settings.gradle for list of all subprojects
+// -----------------------------------------------------------------------------
+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(springSocialXingVersion)
+
+ // default set of maven repositories to be used when resolving dependencies
+ repositories {
+ mavenRepo urls: 'http://maven.springframework.org/release'
+ mavenRepo urls: 'http://maven.springframework.org/milestone'
+ mavenRepo urls: 'http://maven.springframework.org/snapshot'
+ mavenCentral()
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+// Create collections of subprojects - each will receive their own configuration
+// - all subprojects that start with spring-social-* are 'java projects'
+// - documentation-related subprojects are not collected here
+//
+// @see configure(*) sections below
+// -----------------------------------------------------------------------------
+
+javaprojects = subprojects.findAll { project ->
+ project.path.startsWith(':spring-social-')
+}
+
+// -----------------------------------------------------------------------------
+// Configuration for all java subprojects
+// -----------------------------------------------------------------------------
+configure(javaprojects) {
+
+ apply plugin: 'java' // tasks for conventional java lifecycle
+ apply plugin: 'maven' // `gradle install` to push jars to local .m2 cache
+ apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project
+ apply plugin: 'idea' // `gradle idea` to generate .ipr/.iml
+
+ // set up dedicated directories for jars and source jars.
+ // this makes it easier when putting together the distribution
+ 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'
+ injectVersion = '1'
+ mockitoVersion = '1.9.0'
+ springVersion = '3.1.0.RELEASE'
+ springSecurityVersion = '3.1.0.RELEASE'
+ springTestMvcVersion = "1.0.0.BUILD-SNAPSHOT"
+ cglibVersion = '2.2.2'
+
+ sourceSets {
+ main {
+ resources {
+ srcDirs = ['src/main/java']
+ }
+ }
+ test {
+ resources {
+ srcDirs = ['src/test/java']
+ }
+ }
+ }
+
+ // dependencies that are common across all java projects
+ dependencies {
+ testCompile "junit:junit-dep:$junitVersion"
+ testCompile "org.mockito:mockito-all:$mockitoVersion"
+ testCompile "org.springframework:spring-test-mvc:$springTestMvcVersion"
+ }
+
+ // enable all compiler warnings (GRADLE-1077)
+ [compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:all']
+
+ // generate .classpath files without GRADLE_CACHE variable (GRADLE-1079)
+ eclipseClasspath.variables = [:]
+}
+
+// -----------------------------------------------------------------------------
+// Configuration for each individual core java subproject
+//
+// @see configure(javaprojects) above for general config
+// -----------------------------------------------------------------------------
+
+project('spring-social-xing') {
+ description = 'Xing API'
+ dependencies {
+ compile "org.springframework.social:spring-social-core:$springSocialVersion"
+ compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
+ compile "javax.inject:javax.inject:$injectVersion"
+ testCompile "cglib:cglib-nodep:$cglibVersion"
+ testCompile "org.springframework:spring-test-mvc:$springTestMvcVersion"
+ 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"
View
@@ -0,0 +1,42 @@
+# 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.
+# ------------------------------------------------------------------------------
+springSocialXingVersion=0.0.2.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>
View
151 gradlew
@@ -0,0 +1,151 @@
+#!/bin/bash
+
+##############################################################################
+## ##
+## Gradle wrapper 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"
+
+GRADLE_APP_NAME=Gradle
+
+warn ( ) {
+ echo "${PROGNAME}: $*"
+}
+
+die ( ) {
+ warn "$*"
+ exit 1
+}
+
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+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
+# 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
+ else
+ JAVACMD="java"
+ fi
+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"
+fi
+
+# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name
+if $darwin; then
+ JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME"
+# we may also want to set -Xdock:image
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ 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=$?
+
+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
Oops, something went wrong.

0 comments on commit fb13339

Please sign in to comment.