Permalink
Browse files

MOBILE-29 Updated to latest Gradle build configuration

  • Loading branch information...
1 parent 79cfe83 commit 05634a9a496014c1fd8a6bfaf8e814b4160d817d @royclarkson royclarkson committed Mar 15, 2012
Showing with 804 additions and 2,888 deletions.
  1. +0 −3 .gitmodules
  2. +201 −202 LICENSE
  3. +1 −18 README.md
  4. +215 −108 build.gradle
  5. +0 −1 buildSrc
  6. BIN docs/src/api/doc-files/th-background.png
  7. +0 −178 docs/src/api/spring-javadoc.css
  8. +0 −202 docs/src/info/license.txt
  9. +0 −35 docs/src/reference/resources/css/highlight.css
  10. +0 −421 docs/src/reference/resources/css/html.css
  11. +0 −69 docs/src/reference/resources/css/manual.css
  12. +0 −99 docs/src/reference/resources/css/stylesheet.css
  13. BIN docs/src/reference/resources/images/bank-router.png
  14. BIN docs/src/reference/resources/images/cafe-demo.png
  15. BIN docs/src/reference/resources/images/cafe-eip.png
  16. BIN docs/src/reference/resources/images/callouts/1.gif
  17. BIN docs/src/reference/resources/images/callouts/1.png
  18. +0 −15 docs/src/reference/resources/images/callouts/1.svg
  19. BIN docs/src/reference/resources/images/callouts/10.gif
  20. BIN docs/src/reference/resources/images/callouts/10.png
  21. +0 −18 docs/src/reference/resources/images/callouts/10.svg
  22. BIN docs/src/reference/resources/images/callouts/11.gif
  23. BIN docs/src/reference/resources/images/callouts/11.png
  24. +0 −16 docs/src/reference/resources/images/callouts/11.svg
  25. BIN docs/src/reference/resources/images/callouts/12.gif
  26. BIN docs/src/reference/resources/images/callouts/12.png
  27. +0 −18 docs/src/reference/resources/images/callouts/12.svg
  28. BIN docs/src/reference/resources/images/callouts/13.gif
  29. BIN docs/src/reference/resources/images/callouts/13.png
  30. +0 −20 docs/src/reference/resources/images/callouts/13.svg
  31. BIN docs/src/reference/resources/images/callouts/14.gif
  32. BIN docs/src/reference/resources/images/callouts/14.png
  33. +0 −17 docs/src/reference/resources/images/callouts/14.svg
  34. BIN docs/src/reference/resources/images/callouts/15.gif
  35. BIN docs/src/reference/resources/images/callouts/15.png
  36. +0 −19 docs/src/reference/resources/images/callouts/15.svg
  37. +0 −20 docs/src/reference/resources/images/callouts/16.svg
  38. +0 −17 docs/src/reference/resources/images/callouts/17.svg
  39. +0 −21 docs/src/reference/resources/images/callouts/18.svg
  40. +0 −20 docs/src/reference/resources/images/callouts/19.svg
  41. BIN docs/src/reference/resources/images/callouts/2.gif
  42. BIN docs/src/reference/resources/images/callouts/2.png
  43. +0 −17 docs/src/reference/resources/images/callouts/2.svg
  44. +0 −20 docs/src/reference/resources/images/callouts/20.svg
  45. +0 −18 docs/src/reference/resources/images/callouts/21.svg
  46. +0 −20 docs/src/reference/resources/images/callouts/22.svg
  47. +0 −22 docs/src/reference/resources/images/callouts/23.svg
  48. +0 −19 docs/src/reference/resources/images/callouts/24.svg
  49. +0 −21 docs/src/reference/resources/images/callouts/25.svg
  50. +0 −22 docs/src/reference/resources/images/callouts/26.svg
  51. +0 −19 docs/src/reference/resources/images/callouts/27.svg
  52. +0 −23 docs/src/reference/resources/images/callouts/28.svg
  53. +0 −22 docs/src/reference/resources/images/callouts/29.svg
  54. BIN docs/src/reference/resources/images/callouts/3.gif
  55. BIN docs/src/reference/resources/images/callouts/3.png
  56. +0 −19 docs/src/reference/resources/images/callouts/3.svg
  57. +0 −22 docs/src/reference/resources/images/callouts/30.svg
  58. BIN docs/src/reference/resources/images/callouts/4.gif
  59. BIN docs/src/reference/resources/images/callouts/4.png
  60. +0 −16 docs/src/reference/resources/images/callouts/4.svg
  61. BIN docs/src/reference/resources/images/callouts/5.gif
  62. BIN docs/src/reference/resources/images/callouts/5.png
  63. +0 −18 docs/src/reference/resources/images/callouts/5.svg
  64. BIN docs/src/reference/resources/images/callouts/6.gif
  65. BIN docs/src/reference/resources/images/callouts/6.png
  66. +0 −19 docs/src/reference/resources/images/callouts/6.svg
  67. BIN docs/src/reference/resources/images/callouts/7.gif
  68. BIN docs/src/reference/resources/images/callouts/7.png
  69. +0 −16 docs/src/reference/resources/images/callouts/7.svg
  70. BIN docs/src/reference/resources/images/callouts/8.gif
  71. BIN docs/src/reference/resources/images/callouts/8.png
  72. +0 −20 docs/src/reference/resources/images/callouts/8.svg
  73. BIN docs/src/reference/resources/images/callouts/9.gif
  74. BIN docs/src/reference/resources/images/callouts/9.png
  75. +0 −19 docs/src/reference/resources/images/callouts/9.svg
  76. BIN docs/src/reference/resources/images/chain.png
  77. BIN docs/src/reference/resources/images/channel.png
  78. BIN docs/src/reference/resources/images/gateway.png
  79. BIN docs/src/reference/resources/images/handler-endpoint.png
  80. BIN docs/src/reference/resources/images/handler.png
  81. BIN docs/src/reference/resources/images/important.png
  82. BIN docs/src/reference/resources/images/loan-broker-eip.png
  83. BIN docs/src/reference/resources/images/logo.png
  84. BIN docs/src/reference/resources/images/message-bus.png
  85. BIN docs/src/reference/resources/images/message.png
  86. BIN docs/src/reference/resources/images/note.png
  87. BIN docs/src/reference/resources/images/quotes-aggregator.png
  88. BIN docs/src/reference/resources/images/router.png
  89. BIN docs/src/reference/resources/images/source-endpoint.png
  90. BIN docs/src/reference/resources/images/source.png
  91. BIN docs/src/reference/resources/images/target-endpoint.png
  92. BIN docs/src/reference/resources/images/target.png
  93. BIN docs/src/reference/resources/images/tip.png
  94. BIN docs/src/reference/resources/images/xdev-spring_logo.jpg
  95. +0 −145 docs/src/reference/resources/xsl/html-custom.xsl
  96. +0 −142 docs/src/reference/resources/xsl/html-single-custom.xsl
  97. +0 −502 docs/src/reference/resources/xsl/pdf-custom.xsl
  98. +1 −43 gradle.properties
  99. BIN gradle/wrapper/gradle-wrapper.jar
  100. +6 −0 gradle/wrapper/gradle-wrapper.properties
  101. +81 −58 gradlew
  102. +32 −68 gradlew.bat
  103. +60 −0 publish-maven.gradle
  104. +0 −16 settings.gradle
  105. 0 {docs → }/src/api/overview.html
  106. 0 {docs/src/info → src/dist}/changelog.txt
  107. +201 −0 src/dist/license.txt
  108. +2 −2 {docs/src/info → src/dist}/notice.txt
  109. +4 −3 {docs/src/info → src/dist}/readme.txt
  110. 0 {docs → }/src/reference/docbook/device.xml
  111. 0 {docs → }/src/reference/docbook/index.xml
  112. 0 {docs → }/src/reference/docbook/overview.xml
View
@@ -1,3 +0,0 @@
-[submodule "buildSrc"]
- path = buildSrc
- url = git://github.com/SpringSource/spring-build-gradle.git
View
Oops, something went wrong.
View
@@ -6,10 +6,7 @@
1. Clone the repository from GitHub:
- $ git clone --recursive git://github.com/SpringSource/spring-mobile.git
-
- _Note: the --recursive switch is important, because Spring Mobile uses
-git submodules, which must also be cloned and initialized._
+ $ git clone git://github.com/SpringSource/spring-mobile.git
2. Navigate into the cloned repository directory:
@@ -19,20 +16,6 @@ git submodules, which must also be cloned and initialized._
$ ./gradlew build
-Alternatively, if "--recursive" is omitted, the following steps are required for a full check out of the source:
-
-1. Clone the repository from GitHub:
-
- $ git clone git://github.com/SpringSource/spring-mobile.git
-
-2. Initialize the submodule
-
- $ git submodule init
-
-3. Update the submodule in your local repository
-
- $ git submodule update
-
## Eclipse
To generate Eclipse metadata (.classpath and .project files), use the following Gradle task:
View
@@ -1,137 +1,244 @@
-/*
- * Copyright 2010-2012 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 Mobile
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// Configuration for the root project
-// -----------------------------------------------------------------------------
-description = 'Spring Mobile'
-abbreviation = 'MOBILE'
-
-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 projects
-// -----------------------------------------------------------------------------
-allprojects {
- // group will translate to groupId during pom generation and deployment
- group = 'org.springframework.mobile'
-
- // 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(springMobileVersion)
-
- // default set of maven repositories to be used when resolving dependencies
+buildscript {
repositories {
- mavenRepo urls: 'http://maven.springframework.org/release'
- mavenRepo urls: 'http://maven.springframework.org/milestone'
- mavenRepo urls: 'http://maven.springframework.org/snapshot'
- mavenCentral()
+ maven { url 'http://repo.springsource.org/plugins-release' }
+ }
+ dependencies {
+ classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.3'
}
}
+configure(allprojects) {
+ apply plugin: 'java'
+ apply plugin: 'eclipse'
+ apply plugin: 'idea'
-// -----------------------------------------------------------------------------
-// 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-mobile-')
-}
-
-
-// -----------------------------------------------------------------------------
-// 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
+ group = 'org.springframework'
- // 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')
+ slf4jLog4jVersion = '1.5.10'
- // add tasks for creating source jars and generating poms etc
- apply from: "$buildSrcDir/maven-deployment.gradle"
+ [compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:none']
- // add tasks for finding and publishing .xsd files
- apply from: "$buildSrcDir/schema-publication.gradle"
+ sourceSets.test.resources.srcDirs = ['src/test/resources', 'src/test/java']
- junitVersion = '4.9'
- log4jVersion = '1.2.16'
- springVersion = '3.1.1.RELEASE'
+ test.systemProperty("java.awt.headless", "true")
+
+ repositories {
+ maven { url "http://repo.springsource.org/libs-release" }
+ maven { url "http://repo.springsource.org/ebr-maven-external" }
+ }
- // dependencies that are common across all java projects
dependencies {
- testCompile "junit:junit:$junitVersion"
- testCompile "log4j:log4j:$log4jVersion"
- testCompile "org.springframework:spring-test:$springVersion"
+ testCompile "junit:junit:4.9"
+ testCompile "org.easymock:easymock:2.5.1"
+ testCompile "org.springframework:spring-test:3.1.1.RELEASE"
+ }
+
+ // servlet-api (2.5) and tomcat-servlet-api (3.0) classpath entries should not be
+ // exported to dependent projects in Eclipse to avoid false compilation errors due
+ // to changing APIs across these versions
+ eclipse.classpath.file.whenMerged { classpath ->
+ classpath.entries.findAll { entry -> entry.path.contains('servlet-api') }*.exported = false
+ }
+}
+
+configure(subprojects) { subproject ->
+ apply from: "${rootProject.projectDir}/publish-maven.gradle"
+
+ jar {
+ manifest.attributes['Implementation-Title'] = subproject.name
+ manifest.attributes['Implementation-Version'] = subproject.version
+
+ from("${rootProject.projectDir}/src/dist") {
+ include "license.txt"
+ include "notice.txt"
+ into "META-INF"
+ expand(copyright: new Date().format('yyyy'), version: project.version)
+ }
+ }
+
+ javadoc {
+ options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
+ options.author = true
+ options.header = project.name
+ //options.overview = "${projectDir}/src/main/java/overview.html"
}
- // enable all compiler warnings (GRADLE-1077)
- [compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:all']
+ task sourcesJar(type: Jar, dependsOn:classes) {
+ classifier = 'sources'
+ from sourceSets.main.allJava
+ }
+
+ task javadocJar(type: Jar) {
+ classifier = 'javadoc'
+ from javadoc
+ }
- // generate .classpath files without GRADLE_CACHE variable (GRADLE-1079)
- eclipseClasspath.variables = [:]
+ artifacts {
+ archives sourcesJar
+ archives javadocJar
+ }
}
-// -----------------------------------------------------------------------------
-// Configuration for each individual core java subproject
-//
-// @see configure(javaprojects) above for general config
-// -----------------------------------------------------------------------------
project('spring-mobile-device') {
description = 'Spring Mobile Device Resolution Support'
dependencies {
- compile "org.springframework:spring-webmvc:$springVersion"
+ compile "org.springframework:spring-webmvc:3.1.1.RELEASE"
compile ("javax.servlet:servlet-api:2.5") { provided = true }
+// testCompile "log4j:log4j:1.2.16"
+ }
+}
+
+configure(rootProject) {
+ description = 'Spring Mobile'
+
+ apply plugin: 'docbook-reference'
+
+ reference {
+ sourceDir = file('src/reference/docbook')
+ }
+
+ // don't publish the default jar for the root project
+ configurations.archives.artifacts.clear()
+
+ dependencies { // for integration tests
+ }
+
+ task api(type: Javadoc) {
+ group = 'Documentation'
+ description = 'Generates aggregated Javadoc API documentation.'
+ title = "${rootProject.description} ${version} API"
+ options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
+ options.author = true
+ options.header = rootProject.description
+ options.overview = 'src/api/overview.html'
+ options.links(
+ 'http://docs.jboss.org/jbossas/javadoc/4.0.5/connector'
+ )
+ source subprojects.collect { project ->
+ project.sourceSets.main.allJava
+ }
+ destinationDir = new File(buildDir, "api")
+ classpath = files(subprojects.collect { project ->
+ project.sourceSets.main.compileClasspath
+ })
+ maxMemory = '1024m'
+ }
+
+ task docsZip(type: Zip) {
+ group = 'Distribution'
+ classifier = 'docs'
+ description = "Builds -${classifier} archive containing api and reference " +
+ "for deployment at static.springframework.org/spring-mobile/docs."
+
+ from('src/dist') {
+ include 'changelog.txt'
+ }
+
+ from (api) {
+ into 'api'
+ }
+
+ from (reference) {
+ into 'reference'
+ }
}
+
+ task schemaZip(type: Zip) {
+ group = 'Distribution'
+ classifier = 'schema'
+ description = "Builds -${classifier} archive containing all " +
+ "XSDs for deployment at static.springframework.org/schema."
+
+ subprojects.each { subproject ->
+ def Properties schemas = new Properties();
+
+ subproject.sourceSets.main.resources.find {
+ it.path.endsWith('META-INF/spring.schemas')
+ }?.withInputStream { schemas.load(it) }
+
+ for (def key : schemas.keySet()) {
+ def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
+ assert shortName != key
+ File xsdFile = subproject.sourceSets.main.resources.find {
+ it.path.endsWith(schemas.get(key))
+ }
+ assert xsdFile != null
+ into (shortName) {
+ from xsdFile.path
+ }
+ }
+ }
+ }
+
+ task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
+ group = 'Distribution'
+ classifier = 'dist'
+ description = "Builds -${classifier} archive, containing all jars and docs, " +
+ "suitable for community download page."
+
+ baseDir = "${project.name}-${project.version}";
+
+ from('src/dist') {
+ include 'readme.txt'
+ include 'license.txt'
+ include 'notice.txt'
+ into "${baseDir}"
+ expand(copyright: new Date().format('yyyy'), version: project.version)
+ }
+
+ from(zipTree(docsZip.archivePath)) {
+ into "${baseDir}/docs"
+ }
+
+ from(zipTree(schemaZip.archivePath)) {
+ into "${baseDir}/schema"
+ }
+
+ subprojects.each { subproject ->
+ into ("${baseDir}/libs") {
+ from subproject.jar
+ if (subproject.tasks.findByPath('sourcesJar')) {
+ from subproject.sourcesJar
+ }
+ if (subproject.tasks.findByPath('javadocJar')) {
+ from subproject.javadocJar
+ }
+ }
+ }
+ }
+
+ artifacts {
+ archives docsZip
+ archives schemaZip
+ archives distZip
+ }
+
+ task wrapper(type: Wrapper) {
+ description = 'Generates gradlew[.bat] scripts'
+ gradleVersion = '1.0-milestone-8a'
+ }
+
}
-// -----------------------------------------------------------------------------
-// Configuration for the docs subproject
-// -----------------------------------------------------------------------------
-project('docs') {
- apply from: "$buildSrcDir/docs.gradle"
+task updateRootDocs << {
+ copy {
+ from 'src/dist'
+ into "${rootProject.projectDir}"
+ include 'notice.txt'
+ expand(copyright: new Date().format('yyyy'), version: project.version)
+ rename { filename -> 'NOTICE' }
+ }
+
+ copy {
+ from 'src/dist'
+ into "${rootProject.projectDir}"
+ include 'license.txt'
+ rename { filename -> 'LICENSE' }
+ }
}
-apply from: "$buildSrcDir/dist.gradle"
-apply from: "$buildSrcDir/checks.gradle"
+build.dependsOn('updateRootDocs')
Submodule buildSrc deleted from db4431
Deleted file not rendered
Oops, something went wrong.

0 comments on commit 05634a9

Please sign in to comment.