Add support for generating limited local javadocs based on our dependency graph

This commit is contained in:
R. Tyler Croy 2016-12-19 09:32:31 -08:00
parent 0c2663c9ff
commit 5c89a50ab3
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 29 additions and 6 deletions

View File

@ -28,13 +28,17 @@ repositories {
jcenter() jcenter()
} }
dependencies { configurations {
compile 'org.codehaus.groovy:groovy-all:[2.4.7,2.5.0)' localJavadocs
compile "io.dropwizard:dropwizard-core:${dropwizardVersion}" }
compile "io.dropwizard:dropwizard-views-mustache:${dropwizardVersion}"
testCompile "io.dropwizard:dropwizard-testing:${dropwizardVersion}" dependencies {
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4' compile withSource('org.codehaus.groovy:groovy-all:[2.4.7,2.5.0)')
compile withSource("io.dropwizard:dropwizard-core:${dropwizardVersion}")
compile withSource("io.dropwizard:dropwizard-views-mustache:${dropwizardVersion}")
testCompile withSource("io.dropwizard:dropwizard-testing:${dropwizardVersion}")
testCompile withSource('org.spockframework:spock-core:1.0-groovy-2.4')
} }
task generateExampleYaml { task generateExampleYaml {
@ -63,3 +67,22 @@ test {
events "passed", "skipped", "failed", "standardOut", "standardError" events "passed", "skipped", "failed", "standardOut", "standardError"
} }
} }
def withSource(String dependency) {
configurations.localJavadocs.dependencies.add(dependencies.create("${dependency}:sources"))
return dependency
}
task localdoc(type: Javadoc) {
group 'Documentation'
description 'Generate javadoc for the dependencies of the project'
destinationDir = file("${buildDir}/generated-docs")
source = configurations.localJavadocs.files.collect { sourceArtifact ->
zipTree(sourceArtifact).findAll { it.name.endsWith('java') }
}
title 'Generated Docs'
failOnError false
}