Build updates to include uploading of distro and docs, plus addition of admon graphics path to docbook plugin.
This commit is contained in:
parent
9734e4c82f
commit
dbf673ec37
|
@ -5,3 +5,4 @@ target/
|
||||||
build/
|
build/
|
||||||
*.log
|
*.log
|
||||||
.gradle/
|
.gradle/
|
||||||
|
gradle.properties
|
||||||
|
|
77
build.gradle
77
build.gradle
|
@ -6,12 +6,14 @@ apply id: 'base'
|
||||||
allprojects {
|
allprojects {
|
||||||
version = '3.0.2.CI-SNAPSHOT'
|
version = '3.0.2.CI-SNAPSHOT'
|
||||||
releaseBuild = version.endsWith('RELEASE')
|
releaseBuild = version.endsWith('RELEASE')
|
||||||
|
snapshotBuild = version.endsWith('SNAPSHOT')
|
||||||
|
|
||||||
group = 'org.springframework.security'
|
group = 'org.springframework.security'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository'
|
mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository'
|
||||||
mavenCentral()
|
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")
|
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) {
|
task apidocs(type: Javadoc) {
|
||||||
destinationDir = new File(buildDir, 'apidocs')
|
destinationDir = new File(buildDir, 'apidocs')
|
||||||
optionsFile = file("$buildDir/tmp/javadoc.options")
|
optionsFile = file("$buildDir/tmp/javadoc.options")
|
||||||
|
@ -133,8 +149,31 @@ task apidocs(type: Javadoc) {
|
||||||
project.sourceSets.main.compileClasspath })
|
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) {
|
task dist (type: Zip) {
|
||||||
def docsDir = new File(project(':manual').buildDir, 'docs')
|
def docsDir = new File(project(':manual').buildDir, 'docs')
|
||||||
|
def zipRootDir = "${project.name}-$version"
|
||||||
|
into (zipRootDir) {
|
||||||
into('docs/apidocs') {
|
into('docs/apidocs') {
|
||||||
from apidocs.destinationDir
|
from apidocs.destinationDir
|
||||||
}
|
}
|
||||||
|
@ -143,15 +182,36 @@ task dist (type: Zip) {
|
||||||
}
|
}
|
||||||
into('dist') {
|
into('dist') {
|
||||||
from coreModuleProjects().collect { project -> project.libsDir }
|
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 {
|
dist.doLast {
|
||||||
ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1')
|
ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1')
|
||||||
}
|
}
|
||||||
|
|
||||||
dist.dependsOn apidocs, ':manual:doc'
|
task uploadDist << {
|
||||||
dist.dependsOn subprojects.collect { "$it.path:assemble" }
|
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() {
|
def javaProjects() {
|
||||||
subprojects.findAll { project -> project.name != 'faq' && project.name != 'manual' }
|
subprojects.findAll { project -> project.name != 'faq' && project.name != 'manual' }
|
||||||
|
@ -164,3 +224,14 @@ def sampleProjects() {
|
||||||
def coreModuleProjects() {
|
def coreModuleProjects() {
|
||||||
javaProjects() - sampleProjects()
|
javaProjects() - sampleProjects()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def releaseType() {
|
||||||
|
if (releaseBuild) {
|
||||||
|
'release'
|
||||||
|
} else if (snapshotBuild) {
|
||||||
|
'snapshot'
|
||||||
|
} else {
|
||||||
|
'milestone'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@ apply id: 'docbook'
|
||||||
docbookSrcFileName = 'springsecurity.xml'
|
docbookSrcFileName = 'springsecurity.xml'
|
||||||
docbookHtml.stylesheet = new File(projectDir, 'src/xsl/html-custom.xsl')
|
docbookHtml.stylesheet = new File(projectDir, 'src/xsl/html-custom.xsl')
|
||||||
docbookFoPdf.stylesheet = new File(projectDir, 'src/xsl/pdf-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]) << {
|
task doc (dependsOn: [docbookHtml, docbookFoPdf]) << {
|
||||||
resourcesDir = new File(projectDir, 'src/resources')
|
resourcesDir = new File(projectDir, 'src/resources')
|
||||||
ant {
|
ant {
|
||||||
docsDir = new File(buildDir, 'docs')
|
docsDir = new File(buildDir, 'docs')
|
||||||
copy(toDir: docsDir) {fileset(dir: resourcesDir)}
|
copy(toDir: docsDir) {fileset(dir: resourcesDir)}
|
||||||
copy(toDir: new File(docsDir, 'images')) {fileset(dir: new File(projectDir, 'src/docbook/images'))}
|
copy(toDir: new File(docsDir, 'images')) {fileset(dir: imagesDir)}
|
||||||
// TODO: Add this to the plugin
|
|
||||||
delete { fileset(dir: docsDir, includes: "*.fo")}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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/docbook.xsl"/>
|
||||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/highlight.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="draft.watermark.image" select="'images/draft.png'"/ -->
|
||||||
<xsl:param name="paper.type" select="'A4'"/>
|
<xsl:param name="paper.type" select="'A4'"/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue