Enable javadoc generation and distribution
This commit is contained in:
54
build.gradle
54
build.gradle
@@ -34,6 +34,15 @@ ext {
|
||||
|
||||
junitVersion = "4.11"
|
||||
mockitoVersion = "1.9.5"
|
||||
|
||||
javadocLinks = [
|
||||
'http://docs.oracle.com/javase/7/docs/api/',
|
||||
'http://docs.oracle.com/javaee/6/api/',
|
||||
'http://docs.spring.io/spring/docs/current/javadoc-api/',
|
||||
'http://docs.spring.io/spring-amqp/docs/latest-ga/api/',
|
||||
'http://docs.spring.io/spring-data/data-mongo/docs/current/api/',
|
||||
'http://docs.spring.io/spring-data/data-redis/docs/current/api/'
|
||||
] as String[]
|
||||
}
|
||||
|
||||
subprojects {
|
||||
@@ -51,13 +60,25 @@ subprojects {
|
||||
sourceCompatibility = 1.6
|
||||
targetCompatibility = 1.6
|
||||
|
||||
javadoc {
|
||||
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
|
||||
options.author = true
|
||||
options.header = project.name
|
||||
}
|
||||
|
||||
task packageSources(type: Jar) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar) {
|
||||
classifier = "javadoc"
|
||||
from javadoc
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives packageSources
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -102,7 +123,40 @@ configure(rootProject) {
|
||||
}
|
||||
}
|
||||
|
||||
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.links(project.ext.javadocLinks)
|
||||
|
||||
source subprojects.collect { project ->
|
||||
project.sourceSets.main.allJava
|
||||
}
|
||||
|
||||
classpath = files(subprojects.collect { project ->
|
||||
project.sourceSets.main.compileClasspath
|
||||
})
|
||||
|
||||
maxMemory = "1024m"
|
||||
destinationDir = new File(buildDir, "api")
|
||||
}
|
||||
|
||||
task docsZip(type: Zip) {
|
||||
group = 'Distribution'
|
||||
classifier = 'docs'
|
||||
description = "Builds -${classifier} archive containing api and reference " +
|
||||
"for deployment at docs.spring.io/spring-cloud/docs."
|
||||
|
||||
from (api) {
|
||||
into 'api'
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives docsZip
|
||||
archives schemaZip
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user