Fold base Gradle project into app Gradle project

RESOLVED FIXED in Firefox 47

Status

defect
RESOLVED FIXED
4 years ago
Last month

People

(Reporter: nalexander, Assigned: nalexander)

Tracking

(Depends on 1 bug, Blocks 4 bugs)

unspecified
mozilla47
Dependency tree / graph

Firefox Tracking Flags

(firefox47 fixed)

Details

Attachments

(1 attachment)

Right now, base is where the action is, and app is a shell project.  This is something a left-over from the Eclipse days, where it the org.mozilla.fennec/org.mozilla.gecko split was hard to handle.  Gradle is more flexible, and we should be able to set the org.mozilla.fennec name as the applicationId and maintain org.mozilla.gecko as the resource package name.  (There are technical blockers based on the fact that we don't currently use a manifest merger for this functionality in moz.build.)

If we do this, we get:
1) better support for Instant Run, since App projects are better supported than library projects;
2) slightly faster builds;
3) better linting.

I expect that improving the linting will make it easier to implement Android 6.0 permissions, since the linter will likely warn when things need to change.
The android:packageName setting is temporary; I'll find a way to make
this better before landing.  I want to get a few folks to run this
commit locally, and I'd like whatever comments on the lint output
mcomella may have.

Review commit: https://reviewboard.mozilla.org/r/31269/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/31269/
Attachment #8709114 - Flags: review?(s.kaspari)
Attachment #8709114 - Flags: review?(michael.l.comella)
sebastian, mcomella: if you can cherry pick this commit or skim it, I'd appreciate it.

vivek: I'd really appreciate help filing and mentoring tickets to address the worst lint failures this exposes.  I see about 1100 locally, some of which are really bad, but most of which are easy to address.

After applying these patches, run |./mach gradle lint| and you should get a nice report.
Flags: needinfo?(vivekb.balakrishnan)
(In reply to Nick Alexander :nalexander from comment #1)
> Created attachment 8709114 [details]
> MozReview Request: Bug 1233882 - Fold base Gradle project into app Gradle
> project. r?sebastian,mcomella
> 
> The android:packageName setting is temporary; I'll find a way to make
> this better before landing.  I want to get a few folks to run this
> commit locally, and I'd like whatever comments on the lint output
> mcomella may have.
> 
> Review commit: https://reviewboard.mozilla.org/r/31269/diff/#index_header
> See other reviews: https://reviewboard.mozilla.org/r/31269/

Worth noting that the combination of Gradle 2.10, com.android.tools.build:gradle:2.0.0-alpha6, and Android Studio 2.0.0 Preview 5 pegs dx in the IDE.  (Builds from the command line work fine.)
Attachment #8709114 - Flags: review?(s.kaspari) → review+
Comment on attachment 8709114 [details]
MozReview Request: Bug 1233882 - Fold base Gradle project into app Gradle project. r?sebastian,mcomella

https://reviewboard.mozilla.org/r/31269/#review28047

Code looks good. The patch doesn't apply cleanly though.
Assignee: nobody → nalexander
Attachment #8709114 - Flags: review?(michael.l.comella) → review+
Comment on attachment 8709114 [details]
MozReview Request: Bug 1233882 - Fold base Gradle project into app Gradle project. r?sebastian,mcomella

https://reviewboard.mozilla.org/r/31269/#review28533

I specifically reviewed the lint portions of this.

I can't run this locally due to other errors from the commits this builds off of. However, the configuration looks good so r+.

That being said, caveat: since we're adding more code (from app) to our config, we'll probably start to have errors again (as opposed to warnings; undoes bug 1177781). So we'll have to fix that.
Depends on: 1242213
Component: Build Config → Build Config & IDE Support
Product: Core → Firefox for Android
https://hg.mozilla.org/integration/fx-team/rev/a7f63b3721cd3ba105990bbb37a87044383d26d9
Bug 1233882 - Fold base Gradle project into app Gradle project. r=sebastian,mcomella
Status: NEW → ASSIGNED
Flags: needinfo?(vivekb.balakrishnan)
https://hg.mozilla.org/integration/fx-team/rev/746468f5d9798ff404a80cd957664e2b69a0e97c
Bug 1233882 - Fold base Gradle project into app Gradle project. r=sebastian,mcomella
Sadly, this relied on the little bit of Bug 1242213 that I had to back out.  We'll find a way to address this next week.
https://hg.mozilla.org/mozilla-central/rev/c35cd215da10
https://hg.mozilla.org/mozilla-central/rev/26cb829eef1b
https://hg.mozilla.org/mozilla-central/rev/66195b41545d
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 47 → mozilla47
You need to log in before you can comment on or make changes to this bug.