-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
234 lines (185 loc) · 7.23 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
apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories {
maven { url 'http://repo.springsource.org/plugins-release' }
jcenter()
}
dependencies {
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
}
}
configure(allprojects) {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'maven'
group = 'org.springframework.social'
sourceCompatibility=1.7
targetCompatibility=1.7
[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.springsource.org/libs-release" }
maven { url "http://repo.springsource.org/libs-milestone" }
maven { url "http://repo.springsource.org/libs-snapshot" }
maven { url "http://repo.springsource.org/ebr-maven-external" }
}
dependencies {
testCompile ("org.hamcrest:hamcrest-library:$hamcrestVersion")
testCompile ("junit:junit-dep:$junitVersion")
testCompile ("org.mockito:mockito-core:$mockitoVersion")
}
// 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"
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
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)
}
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allJava
}
artifacts {
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
}
}
}
bintray {
user = bintrayUser //this usually comes form gradle.properties file in ~/.gradle
key = bintrayKey //this usually comes form gradle.properties file in ~/.gradle
publications = ['mavenJava'] // see publications closure
pkg { //package will be created if does not exist
repo = 'repo'
// userOrg = 'myorg' // an optional organization name when the repo belongs to one of the user's orgs
name = 'spring-social-xing'
desc = 'Package created from spring-social-xing'
licenses = ['Apache-2.0']
labels = ['spring', 'xing','rest','api','social']
}
}
}
project('spring-social-xing') {
description = 'Xing 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:javax.servlet-api:$servletApiVersion", provided)
compile('commons-io:commons-io:2.4')
testCompile("org.springframework:spring-test:$springVersion")
testCompile("org.springframework.security:spring-security-crypto:$springSecurityVersion")
testCompile("org.apache.httpcomponents:httpclient:4.4.1", optional)
}
}
configure(rootProject) {
description = 'Spring Social Xing'
// don't publish the default jar for the root project
configurations.archives.artifacts.clear()
dependencies { // for integration tests
}
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: [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(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 schemaZip
archives distZip
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '4.6'
}
}
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')