Bug 1352015 - Pre: Avoid deprecated Gradle features. r=maliu draft
authorNick Alexander <nalexander@mozilla.com>
Tue, 20 Jun 2017 16:50:12 -0700
changeset 678602 9c2110acb75c643dc049c1c4a67a4125ce1725e9
parent 678601 98440d11720b2f0b67d7ad512f3ba9ac5d84fd9a
child 678603 a79ce6276f4a5a8278ff75847303adaf1963533b
push id83975
push usernalexander@mozilla.com
push dateWed, 11 Oct 2017 16:10:55 +0000
reviewersmaliu
bugs1352015
milestone58.0a1
Bug 1352015 - Pre: 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'
     }