diff --git a/.gitignore b/.gitignore index 4d7a9b9ee3..81f392e62b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ target/ .settings/ build/ *.log -.gradle/ \ No newline at end of file +.gradle/ +gradle.properties diff --git a/build.gradle b/build.gradle index cd0fee88da..5accaa0caf 100644 --- a/build.gradle +++ b/build.gradle @@ -6,12 +6,14 @@ apply id: 'base' allprojects { version = '3.0.2.CI-SNAPSHOT' releaseBuild = version.endsWith('RELEASE') + snapshotBuild = version.endsWith('SNAPSHOT') + group = 'org.springframework.security' repositories { mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository' mavenCentral() - mavenRepo name:'SpringSource Milestone Repo', urls:'http://repository.springsource.com/maven/bundles/milestone' +// mavenRepo name:'SpringSource Milestone Repo', urls:'http://repository.springsource.com/maven/bundles/milestone' } } @@ -121,6 +123,20 @@ configure(javaProjects()) { conf2ScopeMappings.addMapping(1, configurations.provided, "provided") } +repositories { + // Required for ant s3 task + mavenRepo name: "s2.com release", urls: "http://repository.springsource.com/maven/bundles/release" +} + +configurations { + antlibs +} + +dependencies { + antlibs "org.springframework.build:org.springframework.build.aws.ant:3.0.3.RELEASE", + "net.java.dev.jets3t:jets3t:0.6.1" +} + task apidocs(type: Javadoc) { destinationDir = new File(buildDir, 'apidocs') optionsFile = file("$buildDir/tmp/javadoc.options") @@ -133,25 +149,69 @@ task apidocs(type: Javadoc) { project.sourceSets.main.compileClasspath }) } -task dist (type: Zip) { - def docsDir = new File(project(':manual').buildDir, 'docs') - into('docs/apidocs') { +task apitar(type: Tar, dependsOn: apidocs) { + compression = Compression.BZIP2 + classifier = 'apidocs' + into('apidocs') { from apidocs.destinationDir } - into('docs/reference') { - from docsDir - } - into('dist') { - from coreModuleProjects().collect { project -> project.libsDir } +} + +task login << { + ant.input("Please enter the ssh username for host '$sshHost'", addproperty: "ssh.username") + ant.input("Please enter the ssh password '$sshHost'", addproperty: "ssh.password") + def username = ant.properties['ssh.username'] + def password = ant.properties['ssh.password'] +} + +task uploadApidocs (dependsOn: login) << { + ant.scp(file: apitar.archivePath, todir: "${login.username}@$sshHost:$remoteDocsDir", password: password) + ant.sshexec(host: sshHost, username: login.username, password: login.password, command: "cd $remoteDocsDir && tar -xjf ${apitar.archiveName}") + ant.sshexec(host: sshHost, username: login.username, password: login.password, command: "rm $remoteDocsDir/${apitar.archiveName}") +} + +task dist (type: Zip) { + def docsDir = new File(project(':manual').buildDir, 'docs') + def zipRootDir = "${project.name}-$version" + into (zipRootDir) { + into('docs/apidocs') { + from apidocs.destinationDir + } + into('docs/reference') { + from docsDir + } + into('dist') { + from coreModuleProjects().collect { project -> project.libsDir } + from project(':spring-security-samples-tutorial').libsDir + from project(':spring-security-samples-contacts').libsDir + } } } +dist.dependsOn apidocs, ':manual:doc' +dist.dependsOn subprojects.collect { "$it.path:assemble" } + dist.doLast { ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1') } -dist.dependsOn apidocs, ':manual:doc' -dist.dependsOn subprojects.collect { "$it.path:assemble" } +task uploadDist << { + def shaFile = file("${dist.archivePath}.sha1") + assert dist.archivePath.isFile() + assert shaFile.isFile() + ant.taskdef(resource: 'org/springframework/build/aws/ant/antlib.xml', classpath: configurations.antlibs.asPath) + ant.s3(accessKey: s3AccessKey, secretKey: s3SecretAccessKey) { + upload(bucketName: 'dist.springframework.org', file: dist.archivePath, + toFile: releaseType() + "/SEC/${dist.archiveName}", publicRead: 'true') { + metadata(name: 'project.name', value: 'Spring Security') + metadata(name: 'release.type', value: releaseType()) + metadata(name: 'bundle.version', value: version) + metadata(name: 'package.file.name', value: dist.archiveName) + } + upload(bucketName: 'dist.springframework.org', file: shaFile, + toFile: releaseType() + "/SEC/${dist.archiveName}.sha1", publicRead: 'true') + } +} def javaProjects() { subprojects.findAll { project -> project.name != 'faq' && project.name != 'manual' } @@ -164,3 +224,14 @@ def sampleProjects() { def coreModuleProjects() { javaProjects() - sampleProjects() } + +def releaseType() { + if (releaseBuild) { + 'release' + } else if (snapshotBuild) { + 'snapshot' + } else { + 'milestone' + } +} + diff --git a/docs/manual/manual.gradle b/docs/manual/manual.gradle index 710fc46953..0260fc4a8d 100644 --- a/docs/manual/manual.gradle +++ b/docs/manual/manual.gradle @@ -4,14 +4,14 @@ apply id: 'docbook' docbookSrcFileName = 'springsecurity.xml' docbookHtml.stylesheet = new File(projectDir, 'src/xsl/html-custom.xsl') docbookFoPdf.stylesheet = new File(projectDir, 'src/xsl/pdf-custom.xsl') +def imagesDir = new File(projectDir, 'src/docbook/images'); +docbookFoPdf.admonGraphicsPath = "${imagesDir}/" 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")} + copy(toDir: new File(docsDir, 'images')) {fileset(dir: imagesDir)} } } diff --git a/docs/manual/src/xsl/pdf-custom.xsl b/docs/manual/src/xsl/pdf-custom.xsl index c784b53176..5fe37db2fd 100644 --- a/docs/manual/src/xsl/pdf-custom.xsl +++ b/docs/manual/src/xsl/pdf-custom.xsl @@ -20,482 +20,480 @@ --> - - + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:xslthl="http://xslthl.sf.net" + exclude-result-prefixes="xslthl" + version='1.0'> + + - '1' - src/docbook/images/ - - + + - - - + + + - - - - + + + + + Header + ################################################### --> - - - - - -5em - -5em - + + + + + -5em + -5em + + Table of Contents + ################################################### --> - - book toc,title - + + book toc,title + + Custom Header + ################################################### --> - - - - - + + + + + - - - - - - - please define productname in your docbook file! - - - + + + + + + + please define productname in your docbook file! + + + - - - - - - - - - - - + + + + + + - - + + + + - - - + + - - - - + + + + + + + + + Custom Footer + ################################################### --> - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - + + + - - - - - - + + + + + + - - + + - - - - - + + + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + + Extensions + ################################################### --> - + + Paper & Page Size + ################################################### --> - - 0 - 0 - 0 + + 0 + 0 + 0 + Fonts & Styles + ################################################### --> - false + false - - 11 - 8 + + 11 + 8 - - 1.4 + + 1.4 - - left - bold - - - pt - - + + left + bold + + + pt + + - - - - - - - + Let's remove it, so this sucker can use our attribute-set only... --> + + + + + + + - - - 0.8em - 0.8em - 0.8em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.6em - 0.6em - 0.6em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.4em - 0.4em - 0.4em - - - pt - - 0.1em - 0.1em - 0.1em - + + + 0.8em + 0.8em + 0.8em + + + pt + + 0.1em + 0.1em + 0.1em + + + 0.6em + 0.6em + 0.6em + + + pt + + 0.1em + 0.1em + 0.1em + + + 0.4em + 0.4em + 0.4em + + + pt + + 0.1em + 0.1em + 0.1em + - - + + - - - - - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - + + + - - - + + + + + + + + + + + + Tables + ################################################### --> - - - 4pt - 4pt - 4pt - 4pt - + + + 4pt + 4pt + 4pt + 4pt + - 0.1pt - 0.1pt + 0.1pt + 0.1pt + Labels + ################################################### --> - - - + + + - - + + + Programlistings + ################################################### --> - - - - - pt - - + + + + + pt + + - - 1em - 1em - 1em - 0.1em - 0.1em - 0.1em + + 1em + 1em + 1em + 0.1em + 0.1em + 0.1em - #444444 - solid - 0.1pt - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - + #444444 + solid + 0.1pt + 0.5em + 0.5em + 0.5em + 0.5em + 0.5em + 0.5em + - - 1 - - #F0F0F0 - + + 1 + + #F0F0F0 + - - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - + + 0.1em + 0.1em + 0.1em + 0.1em + 0.1em + 0.1em + - - 0.5em - 0.5em - 0.5em - 0.1em - 0.1em - 0.1em - always - - - - - - normal - italic - - - pt - - false - 0.1em - 0.1em - 0.1em - + + 0.5em + 0.5em + 0.5em + 0.1em + 0.1em + 0.1em + always + + Title information for Figures, Examples etc. + ################################################### --> - + + - + Misc + ################################################### --> - - figure after - example after - equation before - table before - procedure before - + + figure after + example after + equation before + table before + procedure before + - 1 + 1 - 0pt + 0pt - 3 + 3 - - - - - - - - - - - - - + + + + + + + + + + + + + + colored and hyphenated links + ################################################### --> - \ No newline at end of file +