Bug 1415298 - Fix finding assets/ in |mach android test| locally. r=maliu,nechen
Upgrading to the Android-Gradle plugin 3.0+ broke |mach android test|
locally. This addresses the issue.
MozReview-Commit-ID: 3vV47ET7d19
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -562,8 +562,19 @@ android.applicationVariants.all { varian
filename.replace 'R.txt', "R-${new Date().format('yyyyMMddHHmmssSSS')}.txt"
}
dependsOn processResourcesTask
}
assembleTask.dependsOn dumpTask
}
+
+// Bug 1415298: make Robolectric find assets. Fix adapted from
+// https://github.com/robolectric/robolectric/issues/2647.
+android.applicationVariants.all { variant ->
+ def productFlavor = ""
+ variant.productFlavors.each {
+ productFlavor += "${it.name.capitalize()}"
+ }
+ def buildType = "${variant.buildType.name.capitalize()}"
+ tasks["compile${productFlavor}${buildType}UnitTestSources"].dependsOn(tasks["merge${productFlavor}${buildType}Assets"])
+}