Bug 1426244 - 1. Fix some errors from javadoc generation; r=nalexander
Tweak the javadoc task arguments to not generate errors for a standard
GeckoView javadoc run.
MozReview-Commit-ID: 931xCtUcX6N
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -175,29 +175,36 @@ android.libraryVariants.all { variant ->
// Javadoc and Sources JAR configuration cribbed from
// https://github.com/mapbox/mapbox-gl-native/blob/d169ea55c1cfa85cd8bf19f94c5f023569f71810/platform/android/MapboxGLAndroidSDK/build.gradle#L85
// informed by
// https://code.tutsplus.com/tutorials/creating-and-publishing-an-android-library--cms-24582,
// and amended from numerous Stackoverflow posts.
def name = variant.name
def javadoc = task "javadoc${name.capitalize()}"(type: Javadoc) {
description = "Generate Javadoc for build variant $name"
- failOnError = false
destinationDir = new File(destinationDir, variant.baseName)
+ classpath = files(variant.javaCompile.classpath.files)
+
source = files(variant.javaCompile.source)
- classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath)
- options.windowTitle("Mozilla GeckoView ${mozconfig.substs.MOZ_APP_VERSION} API Reference")
- options.docTitle("Mozilla GeckoView ${mozconfig.substs.MOZ_APP_VERSION}")
- options.header("Mozilla GeckoView ${mozconfig.substs.MOZ_APP_VERSION} API Reference")
- options.bottom("© 2016 Mozilla. All rights reserved.")
- options.links("http://docs.oracle.com/javase/7/docs/api/")
- options.linksOffline("http://d.android.com/reference/", "$System.env.ANDROID_HOME/docs/reference")
- // TODO: options.overview("src/main/java/overview.html")
- options.group("Mozilla GeckoView", "org.mozilla.gecko*") // TODO: narrow this down.
- exclude '**/R.java', '**/BuildConfig.java', 'com/googlecode/**'
+ exclude '**/R.java', '**/BuildConfig.java', 'com/google/**', 'org/webrtc/**'
+ options.addPathOption('sourcepath', ':').setValue(
+ variant.sourceSets.collect({ it.javaDirectories }).flatten() +
+ variant.generateBuildConfig.sourceOutputDir)
+
+ // javadoc 8 has a bug that requires the rt.jar file from the JRE to be
+ // in the bootclasspath (https://stackoverflow.com/a/30458820).
+ options.bootClasspath = [
+ file("${System.properties['java.home']}/lib/rt.jar")] + android.bootClasspath
+ options.memberLevel = JavadocMemberLevel.PROTECTED
+ options.source = 7
+
+ options.docTitle = "GeckoView ${mozconfig.substs.MOZ_APP_VERSION} API"
+ options.header = "GeckoView ${mozconfig.substs.MOZ_APP_VERSION} API"
+ options.addStringOption('noindex');
+ options.addStringOption('noqualifier', 'java.lang');
}
task "javadocJar${name.capitalize()}"(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task "sourcesJar${name.capitalize()}"(type: Jar) {