Bug 1426244 - 1. Fix some errors from javadoc generation; r=nalexander
authorJim Chen <nchen@mozilla.com>
Sat, 13 Jan 2018 17:41:08 -0500
changeset 453531 516d427dcc01f9702a2819a6990d10a68977b272
parent 453530 0969933b3908afef3035183c93f8fd67d2bcef31
child 453532 14ba5b4ea2ab1c90ca5b3d93dbf92095a0798fa1
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1426244
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
mobile/android/geckoview/build.gradle
--- 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("&copy; 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) {