Bug 1249421 - Include stub AndroidManifest.xml. r=maliu
This should avoid
Bug 1249421, but it will also address an
Android-Gradle plugin 3.0 issue, where the plugin requires the
manifest at Gradle configuration time. Currently we don't provide it
until Gradle evaluation time, leading to this error, and to the plugin
failing.
MozReview-Commit-ID: 4NkiQSooLly
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -111,18 +111,16 @@ android {
// Before Firefox 57, the user interface followed the Australis design.
photon {
dimension "skin"
}
}
sourceSets {
main {
- manifest.srcFile "${project.buildDir}/generated/source/preprocessed_manifest/AndroidManifest.xml"
-
aidl {
srcDir "${topsrcdir}/mobile/android/base/aidl"
}
java {
srcDir "${topsrcdir}/mobile/android/base/java"
srcDir "${topsrcdir}/mobile/android/search/java"
srcDir "${topsrcdir}/mobile/android/services/src/main/java"
@@ -175,16 +173,28 @@ android {
assets {
if (mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY) {
srcDir "${mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets"
}
srcDir "${topsrcdir}/mobile/android/app/assets"
}
}
+ // Every configuration needs the stub manifest at
+ // src/main/AndroidManifest.xml and the generated manifest. We can't
+ // use the main sourceSet without losing the stub, so we cover all the
+ // configurations by enumerating the buildTypes here.
+ debug {
+ manifest.srcFile "${project.buildDir}/generated/source/preprocessed_manifest/AndroidManifest.xml"
+ }
+
+ release {
+ manifest.srcFile "${project.buildDir}/generated/source/preprocessed_manifest/AndroidManifest.xml"
+ }
+
test {
java {
srcDir "${topsrcdir}/mobile/android/tests/background/junit4/src"
if (!mozconfig.substs.MOZ_ANDROID_GCM) {
exclude 'org/mozilla/gecko/gcm/**/*.java'
exclude 'org/mozilla/gecko/push/**/*.java'
}
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This is not the real manifest; it's a stub to satisfy the
+ Android-Gradle plugin. The real manifest is generated from
+ mobile/android/base/AndroidManifest.xml.in. -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.mozilla.gecko">
+</manifest>