Bug 1366644 - Part 1: Avoid deprecated Gradle features. r=maliu draft
authorNick Alexander <nalexander@mozilla.com>
Tue, 20 Jun 2017 16:50:12 -0700
changeset 681830 e0e58acb6062afe6f18945d5d4e02608fe15e8ba
parent 681829 8c1ec73945494d3307148b3e7d0cd44815bab40a
child 681831 f0d9d7eb2b6f701f19cae69bf9428020e3f823d4
push id84947
push usernalexander@mozilla.com
push dateTue, 17 Oct 2017 21:26:05 +0000
reviewersmaliu
bugs1366644
milestone58.0a1
Bug 1366644 - Part 1: Avoid deprecated Gradle features. r=maliu MozReview-Commit-ID: LZ9clAsEUkd
mobile/android/gradle/with_gecko_binaries.gradle
--- a/mobile/android/gradle/with_gecko_binaries.gradle
+++ b/mobile/android/gradle/with_gecko_binaries.gradle
@@ -32,17 +32,17 @@
 // That arrangement labels them nicely in IntelliJ.  See the comment in the
 // :omnijar project for more context.
 evaluationDependsOn(':omnijar')
 
 task buildOmnijar(type:Exec) {
     dependsOn rootProject.generateCodeAndResources
 
     // See comment in :omnijar project regarding interface mismatches here.
-    inputs.source project(':omnijar').sourceSets.main.resources.srcDirs
+    inputs.file(project(':omnijar').sourceSets.main.resources.srcDirs).skipWhenEmpty() 
 
     // Produce a single output file.
     outputs.file "${topobjdir}/dist/fennec/assets/omni.ja"
 
     workingDir "${topobjdir}"
 
     commandLine mozconfig.substs.GMAKE
     args '-C'
@@ -66,30 +66,34 @@ task syncOmnijarFromDistDir(type: Sync) 
     into("${project.buildDir}/generated/omnijar")
     from("${topobjdir}/dist/${omnijar_dir}/omni.ja",
          "${topobjdir}/dist/${omnijar_dir}/assets/omni.ja") {
         // Throw an exception if we find multiple, potentially conflicting omni.ja files.
         duplicatesStrategy 'fail'
     }
 }
 
-task checkLibsExistInDistDir<< {
-    if (syncLibsFromDistDir.source.empty) {
-        throw new GradleException("Required JNI libraries not found in ${topobjdir}/dist/fennec/lib.  Have you built and packaged?")
+task checkLibsExistInDistDir {
+    doLast {
+        if (syncLibsFromDistDir.source.empty) {
+            throw new GradleException("Required JNI libraries not found in ${topobjdir}/dist/fennec/lib.  Have you built and packaged?")
+        }
     }
 }
 
 task syncLibsFromDistDir(type: Sync, dependsOn: checkLibsExistInDistDir) {
     into("${project.buildDir}/generated/jniLibs")
     from("${topobjdir}/dist/fennec/lib")
 }
 
-task checkAssetsExistInDistDir<< {
-    if (syncAssetsFromDistDir.source.empty) {
-        throw new GradleException("Required assets not found in ${topobjdir}/dist/fennec/assets.  Have you built and packaged?")
+task checkAssetsExistInDistDir {
+    doLast {
+        if (syncAssetsFromDistDir.source.empty) {
+            throw new GradleException("Required assets not found in ${topobjdir}/dist/fennec/assets.  Have you built and packaged?")
+        }
     }
 }
 
 task syncAssetsFromDistDir(type: Sync, dependsOn: checkAssetsExistInDistDir) {
     into("${project.buildDir}/generated/assets")
     from("${topobjdir}/dist/fennec/assets") {
         exclude 'omni.ja'
     }