forked from Netflix/Hystrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically aggregate and publish docs (java,groovy,scala)
- Loading branch information
Justin Ryan
committed
Apr 3, 2013
1 parent
498c25f
commit 832eb53
Showing
2 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,11 +63,34 @@ subprojects { project -> | |
} | ||
} | ||
|
||
task aggregateJavadoc(type: Javadoc) { | ||
description = 'Aggregate all subproject docs into a single docs directory' | ||
source subprojects.collect {project -> project.sourceSets.main.allJava } | ||
classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath}) | ||
destinationDir = new File(projectDir, 'doc') | ||
apply plugin: 'github-pages' // Used to create publishGhPages task | ||
|
||
def docTasks = [:] | ||
[Javadoc,ScalaDoc,Groovydoc].each{ Class docClass -> | ||
def allSources = allprojects.tasks*.withType(docClass).flatten()*.source | ||
if (allSources) { | ||
def shortName = docClass.simpleName.toLowerCase() | ||
def docTask = task "aggregate${shortName.capitalize()}"(type: docClass, description: "Aggregate subproject ${shortName}s") { | ||
source = allSources | ||
doFirst { | ||
def classpaths = allprojects.findAll { it.plugins.hasPlugin(JavaPlugin) }.collect { it.sourceSets.main.compileClasspath } | ||
classpath = files(classpaths) | ||
} | ||
} | ||
docTasks[shortName] = docTask | ||
processGhPages.dependsOn(docTask) | ||
} | ||
} | ||
|
||
githubPages { | ||
repoUri = "[email protected]:quidryan/${rootProject.githubProjectName}.git" | ||
pages { | ||
docTasks.each { shortName, docTask -> | ||
from(docTask.outputs.files) { | ||
into "docs/${shortName}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Generate wrapper, which is distributed as part of source to alleviate the need of installing gradle | ||
|