diff --git a/build.gradle b/build.gradle index 39b0056a66..2222243218 100644 --- a/build.gradle +++ b/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() +} diff --git a/docs/faq/build.gradle b/docs/faq/build.gradle deleted file mode 100644 index 984db9a094..0000000000 --- a/docs/faq/build.gradle +++ /dev/null @@ -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)} - } -} diff --git a/docs/faq/faq.gradle b/docs/faq/faq.gradle new file mode 100644 index 0000000000..f81d93061c --- /dev/null +++ b/docs/faq/faq.gradle @@ -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)} + } +} diff --git a/docs/manual/build.gradle b/docs/manual/manual.gradle similarity index 74% rename from docs/manual/build.gradle rename to docs/manual/manual.gradle index 55d3c43bff..710fc46953 100644 --- a/docs/manual/build.gradle +++ b/docs/manual/manual.gradle @@ -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')*/ \ No newline at end of file diff --git a/docs/manual/src/docbook/springsecurity.xml b/docs/manual/src/docbook/springsecurity.xml index d8da8c73d7..0d1c0b10a4 100644 --- a/docs/manual/src/docbook/springsecurity.xml +++ b/docs/manual/src/docbook/springsecurity.xml @@ -10,7 +10,7 @@ Spring Security - 3.0.2.CI-SNAPSHOT + 3.0.1.RELEASE diff --git a/settings.gradle b/settings.gradle index 44bedc9064..259615bc63 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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()