Permalink
Browse files

update gradle build

  • Loading branch information...
1 parent 567eece commit 0b46f189387a80dcc3d58042e2de1dc53af466f0 @leejianwei leejianwei committed Apr 25, 2012
Showing with 159 additions and 318 deletions.
  1. +15 −178 build.gradle
  2. BIN gradle/wrapper/gradle-wrapper.jar
  3. +2 −2 gradle/wrapper/gradle-wrapper.properties
  4. +52 −56 gradlew
  5. +90 −82 gradlew.bat
View
@@ -1,211 +1,48 @@
-// used for artifact names, building doc upload urls, etc.
-description = 'Spring Shell'
-abbreviation = 'SPSH'
-
apply plugin: 'base'
-
-buildscript {
- repositories {
- add(new org.apache.ivy.plugins.resolver.URLResolver()) {
- name = "GitHub"
- addIvyPattern 'http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[artifact]-[revision].[ext]'
- addArtifactPattern 'http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[revision].[ext]'
- }
- mavenCentral()
- mavenLocal()
- mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release"
- mavenRepo name: "springsource-org-external", urls: "http://repository.springsource.com/maven/bundles/external"
-
- }
-
- dependencies {
- classpath 'org.springframework:gradle-stuff:0.1-20110421'
- classpath 'net.sf.docbook:docbook-xsl:1.75.2:ns-resources@zip'
- }
-}
+apply plugin: "java"
+apply plugin: 'eclipse'
+apply plugin: 'idea'
allprojects {
group = 'org.springframework.shell'
version = "$springShellVersion"
-
- releaseBuild = version.endsWith('RELEASE')
- snapshotBuild = version.endsWith('SNAPSHOT')
-
repositories {
mavenLocal()
mavenCentral()
- // Public Spring artefacts
- mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release"
- mavenRepo name: "spring-release", urls: "http://maven.springframework.org/release"
- mavenRepo name: "spring-milestone", urls: "http://maven.springframework.org/milestone"
- mavenRepo name: "spring-snapshot", urls: "http://maven.springframework.org/snapshot"
- mavenRepo name: "sonatype-snapshot", urls: "http://oss.sonatype.org/content/repositories/snapshots"
- mavenRepo name: "ext-snapshots", urls: "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/"
- mavenRepo name: "data-nucleus", urls: "http://www.datanucleus.org/downloads/maven2/"
- mavenRepo name: "conjars.org", urls: "http://conjars.org/repo"
+ maven{
+ url "http://repository.springsource.com/maven/bundles/release"
+ url "http://maven.springframework.org/release"
+ url "http://maven.springframework.org/milestone"
+ url "http://maven.springframework.org/snapshot"
+ url "http://oss.sonatype.org/content/repositories/snapshots"
+ url "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/"
+ url "http://www.datanucleus.org/downloads/maven2/"
+ url "http://conjars.org/repo"
+ }
}
}
-apply plugin: "java"
-apply plugin: "maven"
-apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project
-apply plugin: 'idea' // `gradle idea` to generate .ipr/.iml
-apply plugin: 'docbook'
-
-
-// Common dependencies
dependencies {
-
- // Logging
runtime "log4j:log4j:$log4jVersion"
-
- // Spring Framework
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-context-support:$springVersion"
compile "commons-io:commons-io:$commonsioVersion"
compile "net.sourceforge.jline:jline:$jlineVersion"
compile "org.fusesource.jansi:jansi:$jansiVersion"
-
- // needed for use of @Configuration extension points.
compile "cglib:cglib:$cglibVersion"
// Testing
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.springframework:spring-test:$springVersion"
- testCompile("javax.annotation:jsr250-api:1.0") { optional = true }
+ testCompile "javax.annotation:jsr250-api:1.0"
testRuntime "org.codehaus.groovy:groovy:$groovyVersion"
}
-javaprojects = rootProject
-
-sourceCompatibility = 1.6
-targetCompatibility = 1.6
-
-javadoc {
- srcDir = file("${projectDir}/docs/src/api")
- destinationDir = file("${buildDir}/api")
- tmpDir = file("${buildDir}/api-work")
-
- configure(options) {
- stylesheetFile = file("${srcDir}/spring-javadoc.css")
- overview = "${srcDir}/overview.html"
- docFilesSubDirs = true
- outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
- breakIterator = true
- author = true
- showFromProtected()
-
-// groups = [
-// 'Spring Data Hadoop' : ['org.springframework.data.hadoop*'],
-// ]
-
- links = [
- "http://static.springframework.org/spring/docs/3.0.x/javadoc-api",
- "http://download.oracle.com/javase/6/docs/api",
- "http://logging.apache.org/log4j/docs/api/",
- ]
-
- exclude "org/springframework/data/hadoop/config/**"
- }
-
- title = "${rootProject.description} ${version} API"
-
- // collect all the sources that will be included in the javadoc output
- source javaprojects.collect {project ->
- project.sourceSets.main.allJava
- }
-
- // collect all main classpaths to be able to resolve @see refs, etc.
- // this collection also determines the set of projects that this
- // task dependsOn, thus the runtimeClasspath is used to ensure all
- // projects are included, not just *dependencies* of all classes.
- // this is awkward and took me a while to figure out.
- classpath = files(javaprojects.collect {project ->
- project.sourceSets.main.runtimeClasspath
- })
-
- // copy the images from the doc-files dir over to the target
- doLast { task ->
- copy {
- from file("${task.srcDir}/doc-files")
- into file("${task.destinationDir}/doc-files")
- }
- }
-}
-
-ideaProject {
- withXml { provider ->
- provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
- }
-}
-
task wrapper(type: Wrapper) {
- gradleVersion = '1.0-milestone-3'
- description = "Generate the Gradle wrapper"
- group = "Distribution"
}
-apply from: "$rootDir/maven.gradle"
-
-// Distribution tasks
-task dist(type: Zip) {
- description = "Generate the ZIP Distribution"
- group = "Distribution"
- dependsOn assemble, subprojects*.tasks*.matching { task -> task.name == 'assemble' }
-
-// evaluationDependsOn(':docs')
-
- def zipRootDir = "${project.name}-$version"
- into(zipRootDir) {
- from('/docs/src/info') {
- include '*.txt'
- }
- from('/docs/build/') {
- into 'docs'
- include 'reference/**/*'
- }
- from('samples/') {
- into 'samples'
- exclude '**/build/**'
- exclude '**/bin/**'
- exclude '**/.settings/**'
- exclude '**/.gradle/**'
- exclude '**/.*'
- }
- from('build/') {
- into 'docs'
- include 'api/**/*'
- }
- into('dist') {
- from javaprojects.collect {project -> project.libsDir }
- }
- }
- doLast {
- ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1')
- }
-}
-
-task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload, dependsOn: dist) {
- description = "Upload the ZIP Distribution"
- group = "Distribution"
- archiveFile = dist.archivePath
- projectKey = 'SHDP'
- projectName = 'Spring Data Hadoop'
-}
-
-assemble.dependsOn = ['jar', 'sourceJar', 'javadocJar']
-
-task run(type: JavaExec) {
- description = 'Runs the application'
- main = "org.springframework.shell.Bootstrap"
- classpath = sourceSets.main.runtimeClasspath
-}
-
-//defaultTasks 'run'
-
-
-defaultTasks 'build'
+defaultTasks 'build'
Binary file not shown.
@@ -1,6 +1,6 @@
-#Mon Sep 19 20:44:55 EEST 2011
+#Wed Apr 25 10:23:49 CST 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-rc-2-bin.zip
View
108 gradlew
@@ -1,16 +1,16 @@
#!/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
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -42,54 +42,51 @@ 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
+# 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
-fi
-if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+ 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 [ -z "$JAVA_HOME" ] ; then
- warn "JAVA_HOME environment variable is not set"
fi
# Increase the maximum file descriptors if we can.
@@ -108,15 +105,14 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
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
@@ -143,7 +139,7 @@ if $cygwin ; then
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
- done
+ done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
@@ -158,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"
-exec "$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 "$@"
Oops, something went wrong.

0 comments on commit 0b46f18

Please sign in to comment.