Closed Bug 1799230 Opened 2 years ago Closed 1 year ago

Use Non-Transitive R Classes for Android Components

Categories

(Fenix :: General, task)

All
Android
task

Tracking

(relnote-firefox 109+, firefox109 fixed)

RESOLVED FIXED
Tracking Status
relnote-firefox --- 109+
firefox109 --- fixed

People

(Reporter: fice-t, Assigned: fice-t)

Details

Attachments

(2 files)

Steps to reproduce:

According to Android documentation:

You should use non-transitive R classes to have faster builds for applications with multiple modules. Doing so helps prevent resource duplication by ensuring that each module's R class only contains references to its own resources, without pulling references from its dependencies. This leads to faster builds and the corresponding benefits of compilation avoidance.

Full clean build before (./gradlew --profile --rerun-tasks assembleDebug): ~14m 50s
Full clean build after (./gradlew --profile --rerun-tasks assembleDebug): ~12m 30s

I didn't test incremental compilation, but it should show stronger results on changes to modules that have resources that aren't used by (many) other modules.

This also appears to decrease the apk size of Fenix by ~1MB.

Related PR: https://github.com/mozilla-mobile/firefox-android/pull/92

Attached file GitHub Pull Request
Severity: -- → N/A
Type: enhancement → task
Assignee: nobody → fice-t
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Release Note Request (optional, but appreciated)
[Why is this notable]: Add to Community Contributions section for Android
[Affects Firefox for Android]: only
[Suggested wording]:
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: