Permalink
Browse files

Initial Gradle Integration

  • Loading branch information...
1 parent 76da87c commit d41a1c400bb99b7c3d942508384083788d30f37e @vbfischer committed Jan 20, 2012
Showing with 902 additions and 408 deletions.
  1. +3 −0 .gitmodules
  2. +145 −0 build.gradle
  3. +1 −0 buildSrc
  4. +45 −0 gradle.properties
  5. +151 −0 gradlew
  6. +126 −0 gradlew.bat
  7. +21 −0 settings.gradle
  8. +15 −15 { → spring-social-dropbox}/src/main/java/org/springframework/social/dropbox/api/DropboxApi.java
  9. +9 −9 ...ing-social-dropbox}/src/main/java/org/springframework/social/dropbox/api/DropboxItemMetadata.java
  10. +62 −62 ...ring-social-dropbox}/src/main/java/org/springframework/social/dropbox/api/DropboxUserProfile.java
  11. +21 −21 ...ring-social-dropbox}/src/main/java/org/springframework/social/dropbox/api/impl/DropboxModule.java
  12. +52 −52 ...ng-social-dropbox}/src/main/java/org/springframework/social/dropbox/api/impl/DropboxTemplate.java
  13. +41 −41 ...l-dropbox}/src/main/java/org/springframework/social/dropbox/api/impl/DropboxUserProfileMixin.java
  14. +45 −45 ...ring-social-dropbox}/src/main/java/org/springframework/social/dropbox/connect/DropboxAdapter.java
  15. +15 −15 ...l-dropbox}/src/main/java/org/springframework/social/dropbox/connect/DropboxConnectionFactory.java
  16. +28 −28 ...ial-dropbox}/src/main/java/org/springframework/social/dropbox/connect/DropboxServiceProvider.java
  17. +33 −32 ...al-dropbox}/src/test/java/org/springframework/social/dropbox/api/impl/AbstractDropboxApiTest.java
  18. +37 −37 ...ocial-dropbox}/src/test/java/org/springframework/social/dropbox/api/impl/DropboxTemplateTest.java
  19. +41 −40 ...-social-dropbox}/src/test/java/org/springframework/social/dropbox/connect/DropboxAdapterTest.java
  20. +11 −11 { → spring-social-dropbox}/src/test/resources/profileValid.json
View
@@ -0,0 +1,3 @@
+[submodule "buildSrc"]
+ path = buildSrc
+ url = https://github.com/SpringSource/spring-build-gradle.git
View
@@ -1,5 +1,150 @@
+// -----------------------------------------------------------------------------
+// Main gradle build file for Spring Social Facebook
+// @author Bryce Fischer
+// ** WITH A LOT OF COPY/PASTA from the spring-social-facebook crew of
+// Craig Walls and Chris Beams.
+// -----------------------------------------------------------------------------
+ import org.springframework.build.Version
+
+// -----------------------------------------------------------------------------
+// Configuration for the root project
+// -----------------------------------------------------------------------------
description = 'Spring Social Dropbox'
abbreviation = 'SOCIAL-DROPBOX'
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(springSocialDropboxVersion)
+
+ // 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.BUILD-SNAPSHOT'
+ jacksonVersion = '1.9.3'
+ jspApiVersion = '2.1'
+ junitVersion = '4.10'
+ mockitoVersion = '1.9.0'
+ servletApiVersion = '2.5'
+ springVersion = '3.1.0.RELEASE'
+
+ 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:$springVersion"
+ }
+
+ // 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-dropbox') {
+ description = 'Drobox API'
+ dependencies {
+ compile "org.springframework.social:spring-social-core:$springSocialVersion"
+ compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
+ testCompile "org.springframework.social:spring-social-test:$springSocialVersion"
+ }
+}
+
+project('spring-social-dropbox-web') {
+ description = 'Drobox Web'
+ dependencies {
+ compile ("org.springframework:spring-web:$springVersion")
+ compile ("javax.servlet:servlet-api:$servletApiVersion") { provided = true }
+ compile ("javax.servlet.jsp:jsp-api:$jspApiVersion") { provided = true }
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+// Configuration for the docs subproject
+// -----------------------------------------------------------------------------
+project('docs') {
+ apply from: "$buildSrcDir/docs.gradle"
+}
+
+apply from: "$buildSrcDir/dist.gradle"
+apply from: "$buildSrcDir/checks.gradle"
Submodule buildSrc added at db4431
View
@@ -0,0 +1,45 @@
+# 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.
+#
+# NOTE: This is COPY/PASTA from spring-social-facebook project...
+#
+
+
+# ------------------------------------------------------------------------------
+# 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.
+# ------------------------------------------------------------------------------
+springSocialDropboxVersion=1.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 d41a1c4

Please sign in to comment.