Open Bug 1414058 Opened 7 years ago Updated 2 years ago

Add moz.build Gradle integration point

Categories

(Firefox Build System :: Android Studio and Gradle Integration, enhancement, P5)

enhancement

Tracking

(Not tracked)

People

(Reporter: nalexander, Unassigned)

References

(Blocks 1 open bug)

Details

After Bug 1405396, the default Fennec build configuration is --with-gradle. But the integration is incredibly hairy: it generates resource files, pulls classes.dex and partial APK files out of Gradle's internal builds, and takes pains to be re-entrant from Android Studio. This ticket builds on tickets like Bug 1255915, envisioning a simpler moz.build and Gradle integration. As a straw man, I'd like mobile/android/moz.build to have something like GRADLE_OUTPUTS += ['/path/to/output.apk'] GRADLE_OUTPUTS['/path/to/output.apk'].targets = [':app:assembleOutputApk'] It's basically GENERATED_FILES with multiple output files and with Gradle targets. It's not clear how to wire dependencies into this scheme. On day one, we need to keep strings.xml, and AppConstants.java and friends, generated by the moz.build scheme. (Eventually we can migrate AppConstants.java to use the Gradle BuildConfig mechanism. Any changes to strings.xml require significant reworking of Android l10n, which is a much larger initiative.) Possibly GENERATED_FILES already can connect inputs and outputs.
ted: you were interested in this integration; this is what I'm thinking. Basically, I want |mach build mobile/android| to run a few GENERATED_FILES and then run |mach gradle SOME-TARGETS|, producing a set of known outputs. I'd even like to have a GENERATED_FILES wrapper script that checks the outputs to ensure the contract is not broken.
Flags: needinfo?(ted)
We discussed this on Vidyo today with many of the build peers present and are all in agreement that this seems sensible.
Flags: needinfo?(ted)
Depends on: 1417232
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195 Needinfo :susheel if you think this bug should be re-triaged.
Priority: -- → P5
Product: Firefox for Android → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.