Build updates to include uploading of distro and docs, plus addition of admon graphics path to docbook plugin.

This commit is contained in:
Luke Taylor 2010-01-21 05:28:17 +00:00
parent 9734e4c82f
commit dbf673ec37
4 changed files with 467 additions and 397 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ target/
build/
*.log
.gradle/
gradle.properties

View File

@ -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,8 +149,31 @@ task apidocs(type: Javadoc) {
project.sourceSets.main.compileClasspath })
}
task apitar(type: Tar, dependsOn: apidocs) {
compression = Compression.BZIP2
classifier = 'apidocs'
into('apidocs') {
from apidocs.destinationDir
}
}
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
}
@ -143,15 +182,36 @@ task dist (type: Zip) {
}
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'
}
}

View File

@ -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)}
}
}

View File

@ -27,8 +27,6 @@
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/highlight.xsl"/>
<xsl:param name="admon.graphics">'1'</xsl:param>
<xsl:param name="admon.graphics.path">src/docbook/images/</xsl:param>
<!-- xsl:param name="draft.watermark.image" select="'images/draft.png'"/ -->
<xsl:param name="paper.type" select="'A4'"/>