@@ -6,8 +6,10 @@ buildscript {
6
6
classpath(" io.spring.gradle:dependency-management-plugin:1.0.0.RELEASE" )
7
7
classpath(" io.spring.gradle:propdeps-plugin:0.0.8" )
8
8
classpath(" io.spring.gradle:docbook-reference-plugin:0.3.1" )
9
- classpath(" org.asciidoctor:asciidoctor-gradle-plugin:1.5.3" )
10
9
classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.1" )
10
+ classpath(" org.asciidoctor:asciidoctor-gradle-plugin:1.5.3" )
11
+ classpath(" org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.14" )
12
+ classpath(" org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.6" )
11
13
}
12
14
}
13
15
@@ -86,7 +88,6 @@ configure(allprojects) { project ->
86
88
ext. servletVersion = " 3.1.0"
87
89
ext. slf4jVersion = " 1.7.25"
88
90
ext. snakeyamlVersion = " 1.18"
89
- ext. snifferVersion = " 1.15"
90
91
ext. testngVersion = " 6.11"
91
92
ext. tiles3Version = " 3.0.7"
92
93
ext. tomcatVersion = " 8.5.12"
@@ -104,6 +105,7 @@ configure(allprojects) { project ->
104
105
apply plugin : " java"
105
106
apply plugin : " test-source-set-dependencies"
106
107
apply from : " ${ gradleScriptDir} /ide.gradle"
108
+ apply from : " ${ gradleScriptDir} /sniffer.gradle"
107
109
108
110
// Kotlin compiler does not support JDK 9 yet, see https://youtrack.jetbrains.com/issue/KT-14988
109
111
if (! JavaVersion . current(). java9Compatible) {
@@ -119,11 +121,6 @@ configure(allprojects) { project ->
119
121
}
120
122
}
121
123
122
- configurations {
123
- sniffer
124
- javaApiSignature
125
- }
126
-
127
124
configurations. all {
128
125
// Check for updates every build
129
126
resolutionStrategy. cacheChangingModulesFor 0 , ' seconds'
@@ -192,44 +189,6 @@ configure(allprojects) { project ->
192
189
testCompile(" org.hamcrest:hamcrest-all:${ hamcrestVersion} " )
193
190
testRuntime(" org.apache.logging.log4j:log4j-core:${ log4jVersion} " )
194
191
testRuntime(" org.apache.logging.log4j:log4j-jcl:${ log4jVersion} " )
195
-
196
- sniffer(" org.codehaus.mojo:animal-sniffer-ant-tasks:${ snifferVersion} " )
197
- javaApiSignature(" org.codehaus.mojo.signature:java18:1.0@signature" )
198
- }
199
-
200
- task copyJavaApiSignature(type : Copy ) {
201
- ext. to = file(" $buildDir /javaApiSignature/" )
202
- description " Copy the resolved Animal Sniffer signature dependency artifact to a known location and name"
203
- from configurations. javaApiSignature
204
- into to
205
- rename ' .*signature' , ' javaApi.signature'
206
- }
207
-
208
- task sniff {
209
- group = " Verification"
210
- description = " Checks the Java API signatures"
211
-
212
- dependsOn compileJava
213
- dependsOn copyJavaApiSignature
214
-
215
- inputs. dir sourceSets. main. output. classesDir
216
- inputs. dir copyJavaApiSignature. to
217
-
218
- doLast {
219
- ant. taskdef(
220
- name : ' animalSniffer' ,
221
- classname : ' org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask' ,
222
- classpath : configurations. sniffer. asPath
223
- )
224
-
225
- // TODO: Animal Sniffer currently chokes on optional JDK 9 bytecode in AspectJ 1.9 beta 5
226
- // ant.animalSniffer(
227
- // signature: "$buildDir/javaApiSignature/javaApi.signature",
228
- // classpath: sourceSets.main.compileClasspath.asPath) {
229
- // path(path: sourceSets.main.output.classesDir)
230
- // annotation(className: "org.springframework.lang.UsesSunHttpServer")
231
- // }
232
- }
233
192
}
234
193
235
194
ext. javadocLinks = [
@@ -1240,13 +1199,11 @@ sonarqube {
1240
1199
configure(rootProject) {
1241
1200
description = " Spring Framework"
1242
1201
1243
- apply plugin : " org.asciidoctor.convert"
1244
- apply plugin : " docbook-reference"
1245
1202
apply plugin : " groovy"
1246
1203
apply plugin : " io.spring.dependency-management"
1247
-
1248
1204
// apply plugin: "detect-split-packages"
1249
1205
apply from : " ${ gradleScriptDir} /jdiff.gradle"
1206
+ apply from : " ${ gradleScriptDir} /docs.gradle"
1250
1207
1251
1208
dependencyManagement {
1252
1209
imports {
@@ -1258,25 +1215,6 @@ configure(rootProject) {
1258
1215
applyMavenExclusions = false
1259
1216
}
1260
1217
1261
- asciidoctor {
1262
- sourceDir project. file(' src/asciidoc' )
1263
- separateOutputDirs = false
1264
- backends = [' docbook' ]
1265
- options doctype : ' book' , eruby : ' erubis'
1266
- attributes ' spring-version' : project. version, ' revnumber' : project. version, ' docinfo' : " "
1267
- }
1268
-
1269
- reference {
1270
- sourceDir = asciidoctor. outputDir
1271
- pdfFilename = " spring-framework-reference.pdf"
1272
- epubFilename = " spring-framework-reference.epub"
1273
- expandPlaceholders = " "
1274
- }
1275
-
1276
- afterEvaluate {
1277
- tasks. findAll { it. name. startsWith(" reference" ) }. each{ it. dependsOn. add(" asciidoctor" ) }
1278
- }
1279
-
1280
1218
// TODO: DetectSplitPackagesPlugin fails in line 154 due to method not found on java.io.File.
1281
1219
// TODO: Possibly related to user rights or OS differences; passes on local Windows machine.
1282
1220
// detectSplitPackages {
@@ -1305,159 +1243,6 @@ configure(rootProject) {
1305
1243
testCompile(" org.hsqldb:hsqldb:${ hsqldbVersion} " )
1306
1244
}
1307
1245
1308
- task api(type : Javadoc ) {
1309
- group = " Documentation"
1310
- description = " Generates aggregated Javadoc API documentation."
1311
- title = " ${ rootProject.description} ${ version} API"
1312
-
1313
- dependsOn {
1314
- subprojects. collect {
1315
- it. tasks. getByName(" jar" )
1316
- }
1317
- }
1318
- options. memberLevel = org.gradle.external.javadoc.JavadocMemberLevel . PROTECTED
1319
- options. author = true
1320
- options. header = rootProject. description
1321
- options. overview = " src/api/overview.html"
1322
- options. stylesheetFile = file(" src/api/stylesheet.css" )
1323
- options. splitIndex = true
1324
- options. links(project. ext. javadocLinks)
1325
- options. addStringOption(' Xdoclint:none' , ' -quiet' )
1326
-
1327
- source subprojects. collect { project ->
1328
- project. sourceSets. main. allJava
1329
- }
1330
-
1331
- maxMemory = " 1024m"
1332
- destinationDir = new File (buildDir, " api" )
1333
-
1334
- doFirst {
1335
- classpath = files(
1336
- // Ensure the javadoc process can resolve types compiled from .aj sources
1337
- project(" :spring-aspects" ). sourceSets. main. output
1338
- )
1339
- classpath + = files(subprojects. collect { it. sourceSets. main. compileClasspath })
1340
- }
1341
- }
1342
-
1343
- task docsZip(type : Zip , dependsOn : ' reference' ) {
1344
- group = " Distribution"
1345
- baseName = " spring-framework"
1346
- classifier = " docs"
1347
- description = " Builds -${ classifier} archive containing api and reference " +
1348
- " for deployment at http://static.springframework.org/spring-framework/docs."
1349
-
1350
- from(" src/dist" ) {
1351
- include " changelog.txt"
1352
- }
1353
-
1354
- from (api) {
1355
- into " javadoc-api"
1356
- }
1357
-
1358
- from (reference) {
1359
- into " spring-framework-reference"
1360
- }
1361
- }
1362
-
1363
- task schemaZip(type : Zip ) {
1364
- group = " Distribution"
1365
- baseName = " spring-framework"
1366
- classifier = " schema"
1367
- description = " Builds -${ classifier} archive containing all " +
1368
- " XSDs for deployment at http://springframework.org/schema."
1369
- duplicatesStrategy ' exclude'
1370
- moduleProjects. each { subproject ->
1371
- def Properties schemas = new Properties ();
1372
-
1373
- subproject. sourceSets. main. resources. find {
1374
- it. path. endsWith(" META-INF/spring.schemas" )
1375
- }?. withInputStream { schemas. load(it) }
1376
-
1377
- for (def key : schemas. keySet()) {
1378
- def shortName = key. replaceAll(/ http.*schema.(.*).spring-.*/ , ' $1' )
1379
- assert shortName != key
1380
- File xsdFile = subproject. sourceSets. main. resources. find {
1381
- it. path. endsWith(schemas. get(key))
1382
- }
1383
- assert xsdFile != null
1384
- into (shortName) {
1385
- from xsdFile. path
1386
- }
1387
- }
1388
- }
1389
- }
1390
-
1391
- task distZip(type : Zip , dependsOn : [docsZip, schemaZip]) {
1392
- group = " Distribution"
1393
- baseName = " spring-framework"
1394
- classifier = " dist"
1395
- description = " Builds -${ classifier} archive, containing all jars and docs, " +
1396
- " suitable for community download page."
1397
-
1398
- ext. baseDir = " ${ baseName} -${ project.version} " ;
1399
-
1400
- from(" src/dist" ) {
1401
- include " readme.txt"
1402
- include " license.txt"
1403
- include " notice.txt"
1404
- into " ${ baseDir} "
1405
- expand(copyright : new Date (). format(" yyyy" ), version : project. version)
1406
- }
1407
-
1408
- from(zipTree(docsZip. archivePath)) {
1409
- into " ${ baseDir} /docs"
1410
- }
1411
-
1412
- from(zipTree(schemaZip. archivePath)) {
1413
- into " ${ baseDir} /schema"
1414
- }
1415
-
1416
- moduleProjects. each { subproject ->
1417
- into (" ${ baseDir} /libs" ) {
1418
- from subproject. jar
1419
- if (subproject. tasks. findByPath(" sourcesJar" )) {
1420
- from subproject. sourcesJar
1421
- }
1422
- if (subproject. tasks. findByPath(" javadocJar" )) {
1423
- from subproject. javadocJar
1424
- }
1425
- }
1426
- }
1427
- }
1428
-
1429
- // Create a distribution that contains all dependencies (required and optional).
1430
- // Not published by default; only for use when building from source.
1431
- task depsZip(type : Zip , dependsOn : distZip) { zipTask ->
1432
- group = " Distribution"
1433
- baseName = " spring-framework"
1434
- classifier = " dist-with-deps"
1435
- description = " Builds -${ classifier} archive, containing everything " +
1436
- " in the -${ distZip.classifier} archive plus all runtime dependencies."
1437
-
1438
- from zipTree(distZip. archivePath)
1439
-
1440
- gradle. taskGraph. whenReady { taskGraph ->
1441
- if (taskGraph. hasTask(" :${ zipTask.name} " )) {
1442
- def projectNames = rootProject. subprojects* . name
1443
- def artifacts = new HashSet ()
1444
- subprojects. each { subproject ->
1445
- (subproject. configurations. runtime. resolvedConfiguration. resolvedArtifacts +
1446
- subproject. configurations. optional. resolvedConfiguration. resolvedArtifacts). each { artifact ->
1447
- def dependency = artifact. moduleVersion. id
1448
- if (! projectNames. contains(dependency. name)) {
1449
- artifacts << artifact. file
1450
- }
1451
- }
1452
- }
1453
-
1454
- zipTask. from(artifacts) {
1455
- into " ${ distZip.baseDir} /deps"
1456
- }
1457
- }
1458
- }
1459
- }
1460
-
1461
1246
artifacts {
1462
1247
archives docsZip
1463
1248
archives schemaZip
@@ -1497,22 +1282,6 @@ configure(project(':spring-core')) {
1497
1282
}
1498
1283
}
1499
1284
1500
- /*
1501
- * Copyright 2002-2016 the original author or authors.
1502
- *
1503
- * Licensed under the Apache License, Version 2.0 (the "License");
1504
- * you may not use this file except in compliance with the License.
1505
- * You may obtain a copy of the License at
1506
- *
1507
- * http://www.apache.org/licenses/LICENSE-2.0
1508
- *
1509
- * Unless required by applicable law or agreed to in writing, software
1510
- * distributed under the License is distributed on an "AS IS" BASIS,
1511
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1512
- * See the License for the specific language governing permissions and
1513
- * limitations under the License.
1514
- */
1515
-
1516
1285
/*
1517
1286
* Support publication of artifacts versioned by topic branch.
1518
1287
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
0 commit comments