Bug 1366644 - Part 1: Avoid deprecated Gradle features. r=maliu
MozReview-Commit-ID: LZ9clAsEUkd
--- 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'
}