1
+ // used for artifact names, building doc upload urls, etc.
2
+ description = ' Spring Hadoop'
3
+ abbreviation = ' SHDP'
4
+
5
+ apply plugin : ' base'
6
+
7
+ buildscript {
8
+ repositories {
9
+ add(new org.apache.ivy.plugins.resolver.URLResolver ()) {
10
+ name = " GitHub"
11
+ addIvyPattern ' http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[artifact]-[revision].[ext]'
12
+ addArtifactPattern ' http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[revision].[ext]'
13
+ }
14
+ mavenCentral()
15
+ mavenLocal()
16
+ mavenRepo name : " springsource-org-release" , urls : " http://repository.springsource.com/maven/bundles/release"
17
+ mavenRepo name : " springsource-org-external" , urls : " http://repository.springsource.com/maven/bundles/external"
18
+ }
19
+
20
+ dependencies {
21
+ classpath ' org.springframework:gradle-stuff:0.1-20110421'
22
+ classpath ' net.sf.docbook:docbook-xsl:1.75.2:ns-resources@zip'
23
+ }
24
+ }
25
+
26
+ allprojects {
27
+ group = ' org.springframework.hadoop'
28
+ version = " $springHadoopVersion "
29
+
30
+ releaseBuild = version. endsWith(' RELEASE' )
31
+ snapshotBuild = version. endsWith(' SNAPSHOT' )
32
+
33
+
34
+ repositories {
35
+ mavenLocal()
36
+ mavenCentral()
37
+ // Public Spring artefacts
38
+ mavenRepo name : " springsource-org-release" , urls : " http://repository.springsource.com/maven/bundles/release"
39
+ mavenRepo name : " spring-release" , urls : " http://maven.springframework.org/release"
40
+ mavenRepo name : " spring-milestone" , urls : " http://maven.springframework.org/milestone"
41
+ mavenRepo name : " spring-snapshot" , urls : " http://maven.springframework.org/snapshot"
42
+ mavenRepo name : " sonatype-snapshot" , urls : " http://oss.sonatype.org/content/repositories/snapshots"
43
+ mavenRepo name : " ext-snapshots" , urls : " http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/"
44
+ }
45
+
46
+ }
47
+
48
+
49
+ apply plugin : " java"
50
+ apply plugin : " maven"
51
+ apply plugin : ' eclipse' // `gradle eclipse` to generate .classpath/.project
52
+ apply plugin : ' idea' // `gradle idea` to generate .ipr/.iml
53
+ apply plugin : ' docbook'
54
+ apply plugin : ' bundlor' // all core projects should be OSGi-compliant
55
+
56
+ bundlor. useProjectProps = true
57
+ [compileJava, compileTestJava]* . options* . compilerArgs = [" -Xlint:-serial" ]
58
+
59
+ // test {
60
+ // forkEvery = 1
61
+ // }
62
+
63
+ // Common dependencies
64
+ dependencies {
65
+ // Logging
66
+ compile " org.slf4j:slf4j-api:$slf4jVersion "
67
+ compile " org.slf4j:jcl-over-slf4j:$slf4jVersion "
68
+ runtime " log4j:log4j:$log4jVersion "
69
+ runtime " org.slf4j:slf4j-log4j12:$slf4jVersion "
70
+
71
+ // Spring Framework
72
+ compile(" org.springframework:spring-core:$springVersion " ) {
73
+ exclude module : " commons-logging"
74
+ }
75
+ compile " org.springframework:spring-context-support:$springVersion "
76
+ compile " org.springframework:spring-tx:$springVersion "
77
+ compile " org.springframework:spring-aop:$springVersion "
78
+ compile " org.springframework:spring-oxm:$springVersion "
79
+
80
+ // Hadoop
81
+ compile " org.apache.hadoop:hadoop-core:$hadoopVersion "
82
+
83
+ compile " commons-io:commons-io:$commonsioVersion "
84
+ compile " org.codehaus.jackson:jackson-core-asl:$jacksonVersion "
85
+ compile " org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion "
86
+ compile " cglib:cglib:$cglibVersion "
87
+
88
+ // Testing
89
+ testCompile " junit:junit:$junitVersion "
90
+ testCompile " org.mockito:mockito-core:$mockitoVersion "
91
+ testCompile " org.springframework:spring-test:$springVersion "
92
+ testCompile(" javax.annotation:jsr250-api:1.0" ) { optional = true }
93
+ }
94
+
95
+ javaprojects = rootProject
96
+
97
+ sourceCompatibility = 1.5
98
+ targetCompatibility = 1.5
99
+
100
+ javadoc {
101
+ srcDir = file(" ${ projectDir} /docs/src/api" )
102
+ destinationDir = file(" ${ buildDir} /api" )
103
+ tmpDir = file(" ${ buildDir} /api-work" )
104
+
105
+ configure(options) {
106
+ stylesheetFile = file(" ${ srcDir} /spring-javadoc.css" )
107
+ overview = " ${ srcDir} /overview.html"
108
+ docFilesSubDirs = true
109
+ outputLevel = org.gradle.external.javadoc.JavadocOutputLevel . QUIET
110
+ breakIterator = true
111
+ showFromProtected()
112
+ groups = [
113
+ ' Spring Hadoop' : [' org.springframework.hadoop*' ],
114
+ ]
115
+
116
+ links = [
117
+ " http://static.springframework.org/spring/docs/3.1.x/javadoc-api" ,
118
+ " http://download.oracle.com/javase/6/docs/api" ,
119
+ " http://logging.apache.org/log4j/docs/api/" ,
120
+ " http://atinject.googlecode.com/svn/trunk/javadoc/" ,
121
+ " http://jakarta.apache.org/commons/logging/apidocs/"
122
+ ]
123
+
124
+ exclude " org/springframework/hadoop/config/**"
125
+ }
126
+
127
+ title = " ${ rootProject.description} ${ version} API"
128
+
129
+ // collect all the sources that will be included in the javadoc output
130
+ source javaprojects. collect {project ->
131
+ project. sourceSets. main. allJava
132
+ }
133
+
134
+ // collect all main classpaths to be able to resolve @see refs, etc.
135
+ // this collection also determines the set of projects that this
136
+ // task dependsOn, thus the runtimeClasspath is used to ensure all
137
+ // projects are included, not just *dependencies* of all classes.
138
+ // this is awkward and took me a while to figure out.
139
+ classpath = files(javaprojects. collect {project ->
140
+ project. sourceSets. main. runtimeClasspath
141
+ })
142
+
143
+ // copy the images from the doc-files dir over to the target
144
+ doLast { task ->
145
+ copy {
146
+ from file(" ${ task.srcDir} /doc-files" )
147
+ into file(" ${ task.destinationDir} /doc-files" )
148
+ }
149
+ }
150
+ }
151
+
152
+ ideaProject {
153
+ withXml { provider ->
154
+ provider. node. component. find { it. @name == ' VcsDirectoryMappings' }. mapping. @vcs = ' Git'
155
+ }
156
+ }
157
+
158
+ task wrapper (type : Wrapper ) {
159
+ gradleVersion = ' 1.0-milestone-3'
160
+ description = " Generate the Gradle wrapper"
161
+ group = " Distribution"
162
+ }
163
+
164
+ apply from : " $rootDir /maven.gradle"
165
+
166
+ assemble. dependsOn = [' jar' , ' sourceJar' , ' javadocJar' ]
167
+
168
+ // Distribution tasks
169
+ task dist (type : Zip ) {
170
+ description = " Generate the ZIP Distribution"
171
+ group = " Distribution"
172
+ dependsOn assemble, subprojects* . tasks* . matching { task -> task. name == ' assemble' }
173
+
174
+ evaluationDependsOn(' :docs' )
175
+
176
+ def zipRootDir = " ${ project.name} -$version "
177
+ into(zipRootDir) {
178
+ from(' /docs/src/info' ) {
179
+ include ' *.txt'
180
+ }
181
+ from(' /docs/build/' ) {
182
+ into ' docs'
183
+ include ' reference/**/*'
184
+ }
185
+ from(' build/' ) {
186
+ into ' docs'
187
+ include ' api/**/*'
188
+ }
189
+ into(' dist' ) {
190
+ from javaprojects. collect {project -> project. libsDir }
191
+ }
192
+ }
193
+ doLast {
194
+ ant. checksum(file : archivePath, algorithm : ' SHA1' , fileext : ' .sha1' )
195
+ }
196
+ }
197
+
198
+ task uploadDist (type : org.springframework.gradle.tasks.S3DistroUpload , dependsOn : dist) {
199
+ description = " Upload the ZIP Distribution"
200
+ group = " Distribution"
201
+ archiveFile = dist. archivePath
202
+ projectKey = ' SGF'
203
+ projectName = ' Spring GemFire'
204
+ }
205
+
206
+ defaultTasks ' clean' , ' build'
0 commit comments