Added tasks for apidocs, doc and distro archive generation to the build file.
This commit is contained in:
parent
10cd080090
commit
56849dc41e
50
build.gradle
50
build.gradle
|
@ -1,6 +1,8 @@
|
|||
import java.util.jar.Manifest
|
||||
import org.gradle.api.tasks.bundling.GradleManifest
|
||||
|
||||
apply id: 'base'
|
||||
|
||||
allprojects {
|
||||
version = '3.0.2.CI-SNAPSHOT'
|
||||
releaseBuild = version.endsWith('RELEASE')
|
||||
|
@ -13,7 +15,7 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
configure(javaProjects()) {
|
||||
apply id: 'java'
|
||||
|
||||
springVersion = '3.0.0.RELEASE'
|
||||
|
@ -75,12 +77,9 @@ subprojects {
|
|||
}
|
||||
|
||||
jar.dependsOn bundlor
|
||||
|
||||
compileJava.doLast {
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
configure(javaProjects()) {
|
||||
apply id: 'maven'
|
||||
|
||||
// Create a source jar for uploading
|
||||
|
@ -121,3 +120,44 @@ subprojects {
|
|||
|
||||
conf2ScopeMappings.addMapping(1, configurations.provided, "provided")
|
||||
}
|
||||
|
||||
task apidocs(type: Javadoc) {
|
||||
destinationDir = new File(buildDir, 'apidocs')
|
||||
optionsFile = file("$buildDir/tmp/javadoc.options")
|
||||
|
||||
source coreModuleProjects().collect { project ->
|
||||
project.sourceSets.main.allJava
|
||||
}
|
||||
|
||||
classpath = files(coreModuleProjects().collect { project ->
|
||||
project.sourceSets.main.compileClasspath })
|
||||
}
|
||||
|
||||
task dist (type: Zip) {
|
||||
def docsDir = new File(project(':manual').buildDir, 'docs')
|
||||
into('docs/apidocs') {
|
||||
from apidocs.destinationDir
|
||||
}
|
||||
into('docs/reference') {
|
||||
from docsDir
|
||||
}
|
||||
|
||||
into('dist') {
|
||||
from coreModuleProjects().collect { project -> project.libsDir }
|
||||
}
|
||||
}
|
||||
|
||||
dist.dependsOn apidocs, ':manual:doc'
|
||||
dist.dependsOn subprojects.collect { "$it.path:assemble" }
|
||||
|
||||
def javaProjects() {
|
||||
subprojects.findAll { project -> project.name != 'faq' && project.name != 'manual' }
|
||||
}
|
||||
|
||||
def sampleProjects() {
|
||||
subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
|
||||
}
|
||||
|
||||
def coreModuleProjects() {
|
||||
javaProjects() - sampleProjects()
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
usePlugin('docbook')
|
||||
|
||||
defaultTasks 'docbookHtmlSingle'
|
||||
|
||||
docbookSrcFileName = 'faq.xml'
|
||||
docbookHtmlSingle.stylesheet = new File(projectDir, 'src/xsl/html-single-custom.xsl')
|
||||
|
||||
docbookHtmlSingle.doLast {
|
||||
resourcesDir = new File(projectDir, 'src/resources')
|
||||
ant {
|
||||
docsDir = new File(buildDir, 'docs')
|
||||
copy(toDir: docsDir) {fileset(dir: resourcesDir)}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
apply id: 'base'
|
||||
apply id: 'docbook'
|
||||
|
||||
defaultTasks 'docbookHtmlSingle'
|
||||
|
||||
docbookSrcFileName = 'faq.xml'
|
||||
docbookHtmlSingle.stylesheet = new File(projectDir, 'src/xsl/html-single-custom.xsl')
|
||||
|
||||
docbookHtmlSingle.doLast {
|
||||
resourcesDir = new File(projectDir, 'src/resources')
|
||||
ant {
|
||||
docsDir = new File(buildDir, 'docs')
|
||||
copy(toDir: docsDir) {fileset(dir: resourcesDir)}
|
||||
}
|
||||
}
|
|
@ -1,19 +1,17 @@
|
|||
apply id: 'base'
|
||||
apply id: 'docbook'
|
||||
|
||||
defaultTasks 'docbookHtml'
|
||||
|
||||
docbookSrcFileName = 'springsecurity.xml'
|
||||
docbookHtml.stylesheet = new File(projectDir, 'src/xsl/html-custom.xsl')
|
||||
docbookFoPdf.stylesheet = new File(projectDir, 'src/xsl/pdf-custom.xsl')
|
||||
|
||||
docbookHtml.doLast {
|
||||
task doc (dependsOn: [docbookHtml, docbookFoPdf]) << {
|
||||
resourcesDir = new File(projectDir, 'src/resources')
|
||||
ant {
|
||||
docsDir = new File(buildDir, 'docs')
|
||||
copy(toDir: docsDir) {fileset(dir: resourcesDir)}
|
||||
copy(toDir: new File(docsDir, 'images')) {fileset(dir: new File(projectDir, 'src/docbook/images'))}
|
||||
// TODO: Add this to the plugin
|
||||
delete { fileset(dir: docsDir, includes: "*.fo")}
|
||||
}
|
||||
}
|
||||
|
||||
/*docbookSrc = new File(project.buildDir, 'docbook/src')
|
||||
docbookDir = new File(project.buildDir, 'docbook/stylesheets')*/
|
|
@ -10,7 +10,7 @@
|
|||
</author>
|
||||
</authorgroup>
|
||||
<productname>Spring Security</productname>
|
||||
<releaseinfo>3.0.2.CI-SNAPSHOT</releaseinfo>
|
||||
<releaseinfo>3.0.1.RELEASE</releaseinfo>
|
||||
</info>
|
||||
<toc/>
|
||||
<preface xml:id="preface">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
String[] modules = [
|
||||
def String[] modules = [
|
||||
'core',
|
||||
'web',
|
||||
'ldap',
|
||||
|
@ -9,12 +9,17 @@ String[] modules = [
|
|||
'taglibs'
|
||||
]
|
||||
|
||||
String[] samples = [
|
||||
def String[] samples = [
|
||||
'tutorial',
|
||||
'contacts',
|
||||
'openid'
|
||||
]
|
||||
|
||||
def String[] docs = [
|
||||
'faq',
|
||||
'manual'
|
||||
]
|
||||
|
||||
include modules
|
||||
|
||||
modules.each {name ->
|
||||
|
@ -32,6 +37,13 @@ samples.each {name ->
|
|||
p.projectDir = new File(settingsDir, "samples/${name}");
|
||||
}
|
||||
|
||||
include docs
|
||||
|
||||
docs.each{ name ->
|
||||
p = findProject(":${name}")
|
||||
p.buildFileName = "${name}.gradle"
|
||||
p.projectDir = new File(settingsDir, "docs/${name}");
|
||||
}
|
||||
|
||||
rootProject.children.each {project ->
|
||||
assert project.buildFile.isFile()
|
||||
|
|
Loading…
Reference in New Issue