Skip to content

Commit

Permalink
Closes mozilla-mobile#691: Dokka: Generate aggregated API docs
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
  • Loading branch information
pocmo and csadilek committed Sep 7, 2018
1 parent 5e76969 commit 9f8b7d3
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ subprojects {
warningsAsErrors true
abortOnError true
}

task docs(type: org.jetbrains.dokka.gradle.DokkaAndroidTask) {
outputFormat = 'html'
reportUndocumented = false
outputDirectory = "${project.rootDir}/build/javadoc/${project.name}"
}
}

if (project.hasProperty("coverage") && project.name != "support-test") {
Expand Down Expand Up @@ -163,6 +157,40 @@ subprojects {
}
}

evaluationDependsOnChildren()

task dokka(type: org.jetbrains.dokka.gradle.DokkaAndroidTask, overwrite: true) {
moduleName = "$rootProject.name"
outputDirectory = "$buildDir/javadoc"
outputFormat = "html"
jdkVersion = 7

subprojects.findAll {
it.hasProperty("android") && !it.name.startsWith("samples")
}.each {
classpath += files(it.android.getBootClasspath().join(File.pathSeparator))
it.android.libraryVariants.all { variant ->
classpath += files(variant.javaCompile.classpath.files)
}
}

sourceDirs = files(subprojects.findAll {
!it.name.startsWith("samples")
}.collect { p ->
def path = new File(p.projectDir, "/src/main/java")

def relativePath = rootDir.toPath().relativize(path.toPath()).toString()
linkMapping {
dir = path
url = "https://github.com/mozilla-mobile/android-components/blob/master/$relativePath"
suffix = "#L"
}

return path
})
}


task clean(type: Delete) {
delete rootProject.buildDir
}
Expand Down

0 comments on commit 9f8b7d3

Please sign in to comment.