Closed
Bug 1485439
Opened 6 years ago
Closed 6 years ago
Enable Java 8 support
Categories
(Firefox Build System :: Android Studio and Gradle Integration, enhancement)
Firefox Build System
Android Studio and Gradle Integration
All
Android
Tracking
(firefox64 fixed)
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: JanH, Assigned: JanH)
References
Details
Attachments
(1 file)
Did we ever consider enabling Java 8 support, or is there any particular reason why we wouldn't want to do this?
Doing this would enable using try-with-resources on all API levels still supported by Firefox, which e.g. allows for a nicer way of locally whitelisting certain StrictMode violations.
Comment 1•6 years ago
|
||
(In reply to Jan Henning [:JanH] from comment #0)
> Did we ever consider enabling Java 8 support, or is there any particular
> reason why we wouldn't want to do this?
It was my understanding that we couldn't without targeting an API level higher than we do -- 19 or 21, IIRC. In the past there were also issues with bytecode and tooling, but I think those are all solved. If we can, we should, 'cuz Java 1.7 is pretty ancient now.
Assignee | ||
Comment 2•6 years ago
|
||
(In reply to Nick Alexander :nalexander [he/him] from comment #1)
> (In reply to Jan Henning [:JanH] from comment #0)
> > Did we ever consider enabling Java 8 support, or is there any particular
> > reason why we wouldn't want to do this?
>
> It was my understanding that we couldn't without targeting an API level
> higher than we do -- 19 or 21, IIRC.
According to https://developer.android.com/studio/write/java8-support, some features are only supported only on API24, or in one case even API26, but everything else now works on any Android version when using a new enough Android plugin to build (not sure if literally *any* version, but certainly any version we still care about, i.e. API16 and up).
Assignee: nobody → jh+bugzilla
Assignee | ||
Comment 3•6 years ago
|
||
Doing so allow to use try-with-resources on all API levels supported by us, not
just starting from API19.
Unfortunately this step also introduces some additional ambiguities in overload
resolution, which means that one of GeckoResult's "then" overloads needs to be
renamed.
We also take the opportunity to update to the current version of the Android
Gradle plugin.
Comment 4•6 years ago
|
||
Comment on attachment 9006084 [details]
Bug 1485439 - Upgrade to Java 8. r?nalexander,jchen
Nick Alexander :nalexander [he/him] has approved the revision.
Attachment #9006084 -
Flags: review+
Comment 5•6 years ago
|
||
Comment on attachment 9006084 [details]
Bug 1485439 - Upgrade to Java 8. r?nalexander,jchen
Jim Chen [:jchen] [:darchons] has approved the revision.
Attachment #9006084 -
Flags: review+
Pushed by mozilla@buttercookie.de:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e3e41bd5523e
Pre: Upgrade Android Gradle plugin. r=nalexander
https://hg.mozilla.org/integration/mozilla-inbound/rev/d81912697dac
Upgrade to Java 8. r=nalexander,jchen
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e3e41bd5523e
https://hg.mozilla.org/mozilla-central/rev/d81912697dac
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Comment 8•6 years ago
|
||
It seems one side effect of this change is it requires any other project that depends on GeckoView to upgrade their target compatibility to 1.8, otherwise the build can fail with rather cryptic errors. For example, I had to manually update my local build of Focus. This is not necessarily bad, but maybe we should send out a message to relevant mailing lists as an announcement.
Comment 9•6 years ago
|
||
(In reply to Jim Chen [:jchen] [:darchons] from comment #8)
> It seems one side effect of this change is it requires any other project
> that depends on GeckoView to upgrade their target compatibility to 1.8,
> otherwise the build can fail with rather cryptic errors. For example, I had
> to manually update my local build of Focus. This is not necessarily bad, but
> maybe we should send out a message to relevant mailing lists as an
> announcement.
Done: https://mail.mozilla.org/pipermail/mobile-firefox-dev/2018-September/002411.html.
Updated•5 years ago
|
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 64 → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•