Bug 1515662 - Copy javadoc jar to right location for publishing. r=nalexander
authorAgi Sferro <agi@mozilla.com>
Thu, 20 Dec 2018 19:37:42 +0000
changeset 511569 ea783721ca9e
parent 511568 f8d8dd0f155a
child 511570 8dd9ac3dae16
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1515662, 1506601
milestone66.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 1515662 - Copy javadoc jar to right location for publishing. r=nalexander In Bug 1506601 we started specifying a version number which made the javadoc jar artifact name change from `geckoview-javadoc.jar` to `geckoview-<version>-javadoc.jar` where `<version>` is the current GeckoView version. This is a good change but it broke our javadoc publishing code which doesn't know about the version code in `//taskcluster/ci/build/android-stuff.yml`. To make that work we add a new task `copyJavadocJar${variantName}` which copies the jar to the expected location. Depends on D15128 Differential Revision: https://phabricator.services.mozilla.com/D15129
mobile/android/geckoview/build.gradle
mobile/android/gradle.configure
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -271,16 +271,26 @@ android.libraryVariants.all { variant ->
         options.tags = ['hide:a:']
     }
 
     def javadocJar = task("javadocJar${name.capitalize()}", type: Jar, dependsOn: javadoc) {
         classifier = 'javadoc'
         from javadoc.destinationDir
     }
 
+    // This task is used by `mach android geckoview-docs`.
+    task("javadocCopyJar${name.capitalize()}", type: Copy) {
+        from(javadocJar.destinationDir) {
+            include 'geckoview-*-javadoc.jar'
+            rename { _ -> 'geckoview-javadoc.jar' }
+        }
+        into javadocJar.destinationDir
+        dependsOn javadocJar
+    }
+
     def sourcesJar = task("sourcesJar${name.capitalize()}", type: Jar) {
         classifier 'sources'
         description = "Generate Javadoc for build variant $name"
         destinationDir = new File(destinationDir, variant.baseName)
         from files(variant.javaCompile.source)
     }
 }
 
--- a/mobile/android/gradle.configure
+++ b/mobile/android/gradle.configure
@@ -280,17 +280,17 @@ def gradle_android_geckoview_docs_tasks(
 
 set_config('GRADLE_ANDROID_GECKOVIEW_DOCS_TASKS', gradle_android_geckoview_docs_tasks)
 
 
 @depends(gradle_android_build_config)
 def gradle_android_geckoview_docs_archive_tasks(build_config):
     '''Gradle tasks run by |mach android geckoview-docs --archive| or |... --upload.'''
     return [
-        'geckoview:javadocJar{geckoview.variant.name}'.format(geckoview=build_config.geckoview),
+        'geckoview:javadocCopyJar{geckoview.variant.name}'.format(geckoview=build_config.geckoview),
     ]
 
 set_config('GRADLE_ANDROID_GECKOVIEW_DOCS_ARCHIVE_TASKS', gradle_android_geckoview_docs_archive_tasks)
 
 
 @depends(gradle_android_build_config)
 def gradle_android_archive_coverage_artifacts_tasks(build_config):
     '''Gradle tasks run by |mach android archive-coverage-artifacts|.'''