Added doc upload capability to build.

This commit is contained in:
Luke Taylor 2010-01-23 02:07:10 +00:00
parent dcf9ea25a6
commit 912e7976da
1 changed files with 24 additions and 6 deletions

View File

@ -137,6 +137,8 @@ dependencies {
"net.java.dev.jets3t:jets3t:0.6.1" "net.java.dev.jets3t:jets3t:0.6.1"
} }
def docsDir = new File(project(':manual').buildDir, 'docs')
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")
@ -157,21 +159,37 @@ task apitar(type: Tar, dependsOn: apidocs) {
} }
} }
task doctar(type: Tar, dependsOn: ':manual:doc') {
compression = Compression.BZIP2
classifier = 'doc'
into('reference') {
from docsDir
}
}
def username;
def password;
task login << { task login << {
ant.input("Please enter the ssh username for host '$sshHost'", addproperty: "ssh.username") ant.input("Please enter the ssh username for host '$sshHost'", addproperty: "ssh.username")
ant.input("Please enter the ssh password '$sshHost'", addproperty: "ssh.password") ant.input("Please enter the ssh password '$sshHost'", addproperty: "ssh.password")
def username = ant.properties['ssh.username'] username = ant.properties['ssh.username']
def password = ant.properties['ssh.password'] password = ant.properties['ssh.password']
} }
task uploadApidocs (dependsOn: login) << { task uploadApidocs (dependsOn: login) << {
ant.scp(file: apitar.archivePath, todir: "${login.username}@$sshHost:$remoteDocsDir", password: password) ant.scp(file: apitar.archivePath, todir: "$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: username, password: password, command: "cd $remoteDocsDir && tar -xjf ${apitar.archiveName}")
ant.sshexec(host: sshHost, username: login.username, password: login.password, command: "rm $remoteDocsDir/${apitar.archiveName}") ant.sshexec(host: sshHost, username: username, password: password, command: "rm $remoteDocsDir/${apitar.archiveName}")
}
task uploadManual (dependsOn: login) << {
ant.scp(file: doctar.archivePath, todir: "$username@$sshHost:$remoteDocsDir", password: password)
ant.sshexec(host: sshHost, username: username, password: password, command: "cd $remoteDocsDir && tar -xjf ${doctar.archiveName}")
ant.sshexec(host: sshHost, username: username, password: password, command: "rm $remoteDocsDir/${doctar.archiveName}")
} }
task dist (type: Zip) { task dist (type: Zip) {
def docsDir = new File(project(':manual').buildDir, 'docs')
def zipRootDir = "${project.name}-$version" def zipRootDir = "${project.name}-$version"
into (zipRootDir) { into (zipRootDir) {
into('docs/apidocs') { into('docs/apidocs') {