Permalink
Browse files

Updated gradle build setup

  • Loading branch information...
1 parent a95803d commit 2765b17913ff6511695d01f7ee5060cece216615 @royclarkson royclarkson committed Nov 15, 2010
Showing with 2,152 additions and 1,419 deletions.
  1. +9 −8 .gitignore
  2. +3 −0 .gitmodules
  3. +46 −74 build.gradle
  4. +0 −162 docs/build.gradle
  5. +3 −8 docs/src/api/overview.html
  6. +1 −176 docs/src/api/spring-javadoc.css
  7. +2 −21 docs/src/info/changelog.txt
  8. +1 −1 docs/src/info/notice.txt
  9. +8 −29 docs/src/info/readme.txt
  10. +43 −0 docs/src/reference/docbook/index.xml
  11. +12 −0 docs/src/reference/docbook/overview.xml
  12. +35 −0 docs/src/reference/resources/css/highlight.css
  13. +421 −0 docs/src/reference/resources/css/html.css
  14. +69 −0 docs/src/reference/resources/css/manual.css
  15. +99 −0 docs/src/reference/resources/css/stylesheet.css
  16. BIN docs/src/reference/resources/images/bank-router.png
  17. BIN docs/src/reference/resources/images/cafe-demo.png
  18. BIN docs/src/reference/resources/images/cafe-eip.png
  19. BIN docs/src/reference/resources/images/callouts/1.gif
  20. BIN docs/src/reference/resources/images/callouts/1.png
  21. +15 −0 docs/src/reference/resources/images/callouts/1.svg
  22. BIN docs/src/reference/resources/images/callouts/10.gif
  23. BIN docs/src/reference/resources/images/callouts/10.png
  24. +18 −0 docs/src/reference/resources/images/callouts/10.svg
  25. BIN docs/src/reference/resources/images/callouts/11.gif
  26. BIN docs/src/reference/resources/images/callouts/11.png
  27. +16 −0 docs/src/reference/resources/images/callouts/11.svg
  28. BIN docs/src/reference/resources/images/callouts/12.gif
  29. BIN docs/src/reference/resources/images/callouts/12.png
  30. +18 −0 docs/src/reference/resources/images/callouts/12.svg
  31. BIN docs/src/reference/resources/images/callouts/13.gif
  32. BIN docs/src/reference/resources/images/callouts/13.png
  33. +20 −0 docs/src/reference/resources/images/callouts/13.svg
  34. BIN docs/src/reference/resources/images/callouts/14.gif
  35. BIN docs/src/reference/resources/images/callouts/14.png
  36. +17 −0 docs/src/reference/resources/images/callouts/14.svg
  37. BIN docs/src/reference/resources/images/callouts/15.gif
  38. BIN docs/src/reference/resources/images/callouts/15.png
  39. +19 −0 docs/src/reference/resources/images/callouts/15.svg
  40. +20 −0 docs/src/reference/resources/images/callouts/16.svg
  41. +17 −0 docs/src/reference/resources/images/callouts/17.svg
  42. +21 −0 docs/src/reference/resources/images/callouts/18.svg
  43. +20 −0 docs/src/reference/resources/images/callouts/19.svg
  44. BIN docs/src/reference/resources/images/callouts/2.gif
  45. BIN docs/src/reference/resources/images/callouts/2.png
  46. +17 −0 docs/src/reference/resources/images/callouts/2.svg
  47. +20 −0 docs/src/reference/resources/images/callouts/20.svg
  48. +18 −0 docs/src/reference/resources/images/callouts/21.svg
  49. +20 −0 docs/src/reference/resources/images/callouts/22.svg
  50. +22 −0 docs/src/reference/resources/images/callouts/23.svg
  51. +19 −0 docs/src/reference/resources/images/callouts/24.svg
  52. +21 −0 docs/src/reference/resources/images/callouts/25.svg
  53. +22 −0 docs/src/reference/resources/images/callouts/26.svg
  54. +19 −0 docs/src/reference/resources/images/callouts/27.svg
  55. +23 −0 docs/src/reference/resources/images/callouts/28.svg
  56. +22 −0 docs/src/reference/resources/images/callouts/29.svg
  57. BIN docs/src/reference/resources/images/callouts/3.gif
  58. BIN docs/src/reference/resources/images/callouts/3.png
  59. +19 −0 docs/src/reference/resources/images/callouts/3.svg
  60. +22 −0 docs/src/reference/resources/images/callouts/30.svg
  61. BIN docs/src/reference/resources/images/callouts/4.gif
  62. BIN docs/src/reference/resources/images/callouts/4.png
  63. +16 −0 docs/src/reference/resources/images/callouts/4.svg
  64. BIN docs/src/reference/resources/images/callouts/5.gif
  65. BIN docs/src/reference/resources/images/callouts/5.png
  66. +18 −0 docs/src/reference/resources/images/callouts/5.svg
  67. BIN docs/src/reference/resources/images/callouts/6.gif
  68. BIN docs/src/reference/resources/images/callouts/6.png
  69. +19 −0 docs/src/reference/resources/images/callouts/6.svg
  70. BIN docs/src/reference/resources/images/callouts/7.gif
  71. BIN docs/src/reference/resources/images/callouts/7.png
  72. +16 −0 docs/src/reference/resources/images/callouts/7.svg
  73. BIN docs/src/reference/resources/images/callouts/8.gif
  74. BIN docs/src/reference/resources/images/callouts/8.png
  75. +20 −0 docs/src/reference/resources/images/callouts/8.svg
  76. BIN docs/src/reference/resources/images/callouts/9.gif
  77. BIN docs/src/reference/resources/images/callouts/9.png
  78. +19 −0 docs/src/reference/resources/images/callouts/9.svg
  79. BIN docs/src/reference/resources/images/chain.png
  80. BIN docs/src/reference/resources/images/channel.png
  81. BIN docs/src/reference/resources/images/gateway.png
  82. BIN docs/src/reference/resources/images/handler-endpoint.png
  83. BIN docs/src/reference/resources/images/handler.png
  84. BIN docs/src/reference/resources/images/important.png
  85. BIN docs/src/reference/resources/images/loan-broker-eip.png
  86. BIN docs/src/reference/resources/images/logo.png
  87. BIN docs/src/reference/resources/images/message-bus.png
  88. BIN docs/src/reference/resources/images/message.png
  89. BIN docs/src/reference/resources/images/note.png
  90. BIN docs/src/reference/resources/images/quotes-aggregator.png
  91. BIN docs/src/reference/resources/images/router.png
  92. BIN docs/src/reference/resources/images/source-endpoint.png
  93. BIN docs/src/reference/resources/images/source.png
  94. BIN docs/src/reference/resources/images/target-endpoint.png
  95. BIN docs/src/reference/resources/images/target.png
  96. BIN docs/src/reference/resources/images/tip.png
  97. BIN docs/src/reference/resources/images/xdev-spring_logo.jpg
  98. +145 −0 docs/src/reference/resources/xsl/html-custom.xsl
  99. +142 −0 docs/src/reference/resources/xsl/html-single-custom.xsl
  100. +502 −0 docs/src/reference/resources/xsl/pdf-custom.xsl
  101. +0 −91 gradle/bundlor.gradle
  102. +0 −90 gradle/checks.gradle
  103. +0 −149 gradle/dist.gradle
  104. +0 −315 gradle/docbook.gradle
  105. +0 −171 gradle/maven-deployment.gradle
  106. +0 −83 gradle/version.gradle
  107. +0 −32 gradle/wrapper.gradle
  108. BIN gradle/wrapper/gradle-wrapper.jar
  109. +0 −9 gradle/wrapper/gradle-wrapper.properties
  110. +36 −0 readme.txt
  111. +2 −0 settings.gradle
View
@@ -1,10 +1,11 @@
*.DS_Store
-build
-**/build
-src/test/java/exploration
+*.iml
+*.ipr
+*.iws
+*.sw?
+.classpath
+.project
+.settings
.gradle
-spring-android-commons-logging/src/test/java/exploration
-spring-android-rest-template/src/test/java/exploration
-**/.classpath
-**/.project
-**/lib
+build
+target
View
@@ -0,0 +1,3 @@
+[submodule "buildSrc"]
+ path = buildSrc
+ url = git://github.com/SpringSource/spring-build-gradle.git
View
@@ -13,117 +13,102 @@
* 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 Mobile Android
-//
-// - run `./gradlew(.bat) build` to kick off a complete compile-test-package
-//
+// Main gradle build file for Spring Mobile
+// @author Chris Beams
// @author Roy Clarkson
// -----------------------------------------------------------------------------
-
// -----------------------------------------------------------------------------
// Configuration for the root project
// -----------------------------------------------------------------------------
-apply from: "$rootDir/gradle/version.gradle"
+description = 'Spring Android'
+abbreviation = 'ANDROID'
+
+apply plugin: 'base'
apply plugin: 'idea'
-// used for artifact names, building doc upload urls, etc.
-description = 'Spring Android'
-abbreviation = 'SPRING-ANDROID'
+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
+// @see settings.gradle for list of all projects
// -----------------------------------------------------------------------------
allprojects {
// group will translate to groupId during pom generation and deployment
- group = 'org.springframework.spring-android'
+ group = 'org.springframework.android'
// 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 = createVersion(springAndroidVersion)
+ version = new Version(springAndroidVersion)
// default set of maven repositories to be used when resolving dependencies
repositories {
- mavenRepo urls: 'http://maven.springframework.org/snapshot'
- mavenCentral()
mavenRepo urls: 'http://maven.springframework.org/release'
mavenRepo urls: 'http://maven.springframework.org/milestone'
- mavenRepo urls: 'http://repository.springsource.com/maven/bundles/external'
- mavenRepo urls: 'http://repository.springsource.com/maven/bundles/release'
- mavenRepo urls: 'http://repository.springsource.com/maven/bundles/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-android-* are 'java projects'
-// - documentation-related subprojects are not collected here
+// Create collection of subprojects - each will receive their own configuration
+// - all subprojects that start with spring-mobile-* are 'java projects'
+// - documentation-related projects are not collected here
//
// @see configure(*) sections below
// -----------------------------------------------------------------------------
-
javaprojects = subprojects.findAll { project ->
project.path.startsWith(':spring-android-')
}
+
// -----------------------------------------------------------------------------
-// Configuration for all java subprojects
+// Configuration for all java projects
// -----------------------------------------------------------------------------
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
+ 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
+
+ // ensure JDK 5 compatibility
+ sourceCompatibility=1.5
+ targetCompatibility=1.5
// 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')
- // all core projects should be OSGi-compliant bundles
- // add the bundlor task to ensure proper manifests
- // apply from: "$rootDir/gradle/bundlor.gradle"
- apply from: "$rootDir/gradle/maven-deployment.gradle"
+ // 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"
- jacksonVersion = '1.5.3'
junitVersion = '4.7'
- mockitoVersion = '1.8.5'
+ log4jVersion = '1.2.16'
springVersion = '3.0.5.RELEASE'
- androidVersion = '1.5_r3'
+ androidVersion = '1.5_r3'
+ jacksonVersion = '1.5.3'
slf4jVersion = '1.6.1'
slf4jAndroidVersion = '1.6.1-RC1'
- sourceSets {
- test {
- resources {
- srcDirs = ['src/test/resources', 'src/test/java']
- }
- }
- }
-
- // 'provided' dependencies should be transitive (e.g. servlet-api)
- configurations {
- provided { transitive = false }
- }
-
- sourceSets.main.compileClasspath += configurations.provided
- sourceSets.test.compileClasspath += configurations.provided
- sourceSets.test.runtimeClasspath += configurations.provided
-
// dependencies that are common across all java projects
dependencies {
- testCompile "junit:junit:$junitVersion"
- testCompile "org.mockito:mockito-all:$mockitoVersion"
- testCompile "org.springframework:spring-test:$springVersion"
+ testCompile "junit:junit:$junitVersion"
+ testCompile "log4j:log4j:$log4jVersion"
+ testCompile "org.springframework:spring-test:$springVersion"
}
// enable all compiler warnings (GRADLE-1077)
@@ -144,8 +129,6 @@ project('spring-android-commons-logging') {
dependencies {
compile ("com.google.android:android:$androidVersion") { provided = true }
}
-
-// println "classpath = ${configurations.compile.collect {File file -> file.name}}"
}
project('spring-android-rest-template') {
@@ -161,8 +144,6 @@ project('spring-android-rest-template') {
compile "org.slf4j:slf4j-android:$slf4jAndroidVersion"
compile files(projLibDir)
}
-
-// println "classpath = ${configurations.compile.collect {File file -> file.name}}"
// configuration for extracting required class files
configurations { dependencyconf }
@@ -269,22 +250,13 @@ project('spring-android-rest-template') {
}
}
-// add basic tasks like 'clean' and 'assemble' to the root project. e.g.: allows
-// running `gradle clean` from the root project and deleting the build directory
-apply plugin: 'base'
-
-// add tasks like 'distArchive'
-apply from: "$rootDir/gradle/dist.gradle"
-
-// add tasks like 'snapshotDependencyCheck'
-apply from: "${rootDir}/gradle/checks.gradle"
-
// -----------------------------------------------------------------------------
-// Import tasks related to releasing and managing the project
-// depending on the role played by the current user.
-//
-// @see gradle.properties for more information on roles
+// Configuration for the docs subproject
// -----------------------------------------------------------------------------
-// add management tasks like `wrapper` for generating the gradlew* scripts
-apply from: "$rootDir/gradle/wrapper.gradle"
+project('docs') {
+ apply from: "$buildSrcDir/docs.gradle"
+}
+
+apply from: "$buildSrcDir/dist.gradle"
+apply from: "$buildSrcDir/checks.gradle"
View
@@ -1,162 +0,0 @@
-/*
- * 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.
- */
-
-apply plugin: 'base'
-
-description = "Spring Android Documentation"
-
-task build(dependsOn: assemble) {
- group = 'Build'
- description = 'Builds reference and API documentation and archives'
-}
-
-
-/**
- * Build aggregated JavaDoc HTML for all core project classes. Result is
- * suitable for packaging into a distribution zip or viewing directly with
- * a browser.
- *
- * @author cbeams
- * @author ltaylor
- * @see http://gradle.org/0.9-rc-1/docs/javadoc/org/gradle/api/tasks/javadoc/Javadoc.html
- */
- task api(type: Javadoc) {
- group = 'Documentation'
- description = "Builds aggregated JavaDoc HTML for all core project classes."
-
- // this task is a bit ugly to configure. it was a user contribution, and
- // Hans tells me it's on the roadmap to redesign it.
- srcDir = file("${projectDir}/src/api")
- destinationDir = file("${buildDir}/api")
- tmpDir = file("${buildDir}/api-work")
- optionsFile = file("${tmpDir}/apidocs/javadoc.options")
- options.stylesheetFile = file("${srcDir}/spring-javadoc.css")
- options.links = ["http://static.springframework.org/spring/docs/3.0.x/javadoc-api"]
- options.overview = "${srcDir}/overview.html"
- options.docFilesSubDirs = true
- title = "Spring Android ${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")
- }
- }
-}
-
-/**
- *
- * @see http://www.gradle.org/0.9-preview-3/docs/userguide/userguide_single.html#sec:copying_files
- * @see http://www.gradle.org/0.9-preview-3/docs/javadoc/org/gradle/api/file/CopySpec.html
- */
-docsSpec = copySpec {
- into("${version}") {
- from('src/info/changelog.txt')
- }
-
- into("${version}/api") {
- from(api.destinationDir)
- }
-}
-
-task archive(type: Zip, dependsOn: [api]) {
- group = "Documentation"
- description = "Create a zip archive of reference and API documentation."
-
- baseName = rootProject.name + '-docs'
-
- // drop it right in the root of the build dir for simplicity
- destinationDir = buildDir
-
- // use the copy spec above to specify the contents of the zip
- with docsSpec
-}
-
-configurations { archives }
-artifacts { archives archive }
-
-configurations { scpAntTask }
-dependencies {
- scpAntTask("org.apache.ant:ant-jsch:1.8.1")
-}
-
-checkForProps(taskPath: project.path + ':uploadArchives', requiredProps: ['sshHost', 'sshUsername'])
-
-uploadArchives {
- def sshHost = project.properties.sshHost
- def sshUsername = project.properties.sshUsername
- def remoteSiteDir = '/var/www/domains/springframework.org/static/htdocs/' + rootProject.name
- def docUrl = "http://${sshHost}/${rootProject.name}/docs/${version}"
- def remoteDocsDir = "${remoteSiteDir}/docs/"
- def fqRemoteDir = "${sshUsername}@${sshHost}:${remoteDocsDir}"
-
- group = 'Buildmaster'
- description = "Uploads and unpacks documentation archive" + (sshHost ? " to ${docUrl}" : ": Host is not specified")
-
- uploadDescriptor = false
-
- repositories {
- add(new org.apache.ivy.plugins.resolver.SshResolver()) {
- name = 'sshHost: ' + sshHost // used for debugging
- host = sshHost
- user = sshUsername
- if (project.hasProperty('remoteSiteDir')) {
- keyFile = sshPrivateKey as File
- }
- addArtifactPattern "${remoteDocsDir}/${archive.archiveName}"
- }
- }
-
- configurations { scpAntTask }
- dependencies { scpAntTask 'org.apache.ant:ant-jsch:1.8.1' }
-
- doFirst {
- println "Uploading: ${archive.archivePath} to ${fqRemoteDir}"
- }
-
- doLast {
- project.ant {
- taskdef(name: 'sshexec',
- classname: 'org.apache.tools.ant.taskdefs.optional.ssh.SSHExec',
- classpath: configurations.scpAntTask.asPath)
-
- // copy the archive, unpack it, then delete it
- def unpackCommand = "cd ${remoteDocsDir} && unzip -K -o ${archive.archiveName}"
- def deleteCommand = "rm ${remoteDocsDir}/${archive.archiveName}"
-
- println "sshexec ${unpackCommand}"
- sshexec(host: sshHost, username: sshUsername, keyfile: sshPrivateKey, command: unpackCommand)
- println "sshexec ${deleteCommand}"
- sshexec(host: sshHost, username: sshUsername, keyfile: sshPrivateKey, command: deleteCommand)
- println "UPLOAD SUCCESSFUL - validate by visiting ${docUrl}"
- }
- }
-}
Oops, something went wrong.

0 comments on commit 2765b17

Please sign in to comment.