forked from vkolodrevskiy/spring-social-vkontakte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
263 lines (219 loc) · 8.19 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
buildscript {
repositories {
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.8'
classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1'
}
}
configure(allprojects) {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'javadocHotfix'
group = 'org.springframework.social'
sourceCompatibility=1.5
targetCompatibility=1.5
ext {
springSocialVersion = '1.1.0.BUILD-SNAPSHOT'
hamcrestVersion = '1.3'
jacksonVersion = '2.2.2'
junitVersion = '4.11'
mockitoVersion = '1.9.5'
servletApiVersion = '2.5'
springVersion = '3.2.3.RELEASE'
springSecurityCryptoVersion = '3.1.4.RELEASE'
}
[compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:none']
sourceSets.test.resources.srcDirs = ['src/test/resources', 'src/test/java']
test.systemProperty("java.awt.headless", "true")
repositories {
maven { url "http://repo.spring.io/libs-release" }
maven { url "http://repo.spring.io/libs-milestone" }
maven { url "http://repo.spring.io/libs-snapshot" }
maven { url "http://repo.spring.io/ebr-maven-external" }
}
dependencies {
testCompile ("org.hamcrest:hamcrest-library:$hamcrestVersion")
testCompile ("junit:junit-dep:$junitVersion")
testCompile ("org.mockito:mockito-core:$mockitoVersion")
testCompile ("org.springframework:spring-test:$springVersion")
}
// 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"
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
project('spring-social-vkontakte') {
description = 'VKontakte API'
dependencies {
compile ("org.springframework.social:spring-social-core:$springSocialVersion")
compile ("org.springframework.social:spring-social-config:$springSocialVersion")
compile ("org.springframework.social:spring-social-security:$springSocialVersion", optional)
compile ("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
compile ("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
compile ("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion")
compile ("javax.servlet:servlet-api:$servletApiVersion", provided)
testCompile ("org.springframework:spring-test:$springVersion")
testCompile ("org.springframework.security:spring-security-crypto:$springSecurityCryptoVersion")
}
}
configure(rootProject) {
description = 'Spring Social VKontakte'
apply plugin: 'docbook-reference'
reference {
ext.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-social/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."
ext.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.10'
}
}
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' }
}
}
build.dependsOn('updateRootDocs')