Skip to content

Commit

Permalink
Fixed aggregate javadoc build
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrobin committed Oct 9, 2017
1 parent d0786de commit d6b0f6e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
34 changes: 28 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,37 @@ distributions {


// task to generate aggregated javadocs
task javadocs(type: Javadoc) {
Set<Project> javadocProjects = [':swe-common-core', ':sensorml-core', ':sensorhub-core']
task alljavadoc(type: Javadoc) {
dependsOn build
source javadocProjects.collect {name -> project(name).sourceSets.main.allJava}
classpath = files(javadocProjects.collect {name -> project(name).sourceSets.main.compileClasspath})
include 'org/sensorhub/api/**', 'net/opengis/**'
destinationDir = file("${buildDir}/docs/javadoc")
}


// task to publish javadocs to GitHub pages (osh-docs)
task releaseJavadoc {
doLast {
Set<Project> javadocProjects = [':swe-common-core', ':sensorml-core', ':sensorhub-core']
source javadocProjects.collect {name -> project(name).sourceSets.main.allJava}
include 'org/sensorhub/api/**', 'net/opengis/**'
classpath = files(javadocProjects.collect {name -> project(name).sourceSets.main.compileClasspath})
println '> Copying Javadoc to GitHub Pages'

def ghPagesDir = "$rootDir/../osh-docs/site/"
if (!new File(ghPagesDir).exists())
throw new GradleException('osh-docs github pages repo was not found locally')

// copy apidocs to osh-docs site repo
def javaDocRepoDir = "apidocs/v" + version
def javadocDir = ghPagesDir + javaDocRepoDir
mkdir javadocDir
copy {
into javadocDir
from ("${buildDir}/docs/javadoc") {
include '**/*'
}
}
}
}

releaseJavadoc.dependsOn javadocs
releaseJavadoc.dependsOn alljavadoc
release.dependsOn releaseJavadoc
23 changes: 0 additions & 23 deletions release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,29 +152,6 @@ task releaseGithub {
}


// this task task publishes javadocs to GitHub pages (osh-docs)
task releaseJavadoc {
doLast {
println '> Copying Javadoc to GitHub Pages'

def ghPagesDir = "$rootDir/../osh-docs/site/"
if (!new File(ghPagesDir).exists())
throw new GradleException('osh-docs github pages repo was not found locally')

// copy apidocs to osh-docs site repo
def javaDocRepoDir = "apidocs/v" + version
copy {
def javadocDir = ghPagesDir + javaDocRepoDir
mkdir javadocDir
into javadocDir
from ('build/docs/javadoc') {
include '**/*'
}
}
}
}


// release subtasks ordering
// prerelease > build > releaseGit > bintrayUpload > releaseGithub
task release
Expand Down

0 comments on commit d6b0f6e

Please sign in to comment.