New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 762967 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature



Sign in to add a comment

Add support for compiling Java 8 JARs

Project Member Reported by sakal@chromium.org, Sep 7 2017

Issue description

Because we are Desugar JARs before distributing them, the following features are not currently available:
1. Default or static interface methods as part of an API
2. Try-with-resources
3. Reflecting on repeated annotations

We should add support for Java 8 JAR generation so these features can be used.
 
Cronet team is working around this by distributing the .javac.jar files:

https://cs.chromium.org/chromium/src/components/cronet/android/BUILD.gn?q=cronet+javac.jar&sq=package:chromium&l=1243

We could move the template into the common rules if that's something you'd like to use as well.

Comment 2 by sakal@chromium.org, Sep 7 2017

Nice to hear we are not the only ones with this issue. Ideally, I think
this should be a flag to dist_jar template. I can experiment with the
template to see if it works for us.
Adding it to dist_jar sgtm.
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 23 2017

The following revision refers to this bug:
  https://webrtc.googlesource.com/src.git/+/7bc55b8e84e76c60d55e33c017858d9cb0984225

commit 7bc55b8e84e76c60d55e33c017858d9cb0984225
Author: Sami Kalliomäki <sakal@webrtc.org>
Date: Thu Nov 23 13:25:58 2017

Update AAR-generation to use non-preprocessed jar files.

Previously Java 8 bytecode was transpiled into Java 7 bytecode for AAR.
With this change we instead include Java 8 bytecode in the AAR.

This drops support for Java 7 but allows using Java 8 features such as
static methods in interfaces and default methods.

Bug:  webrtc:8084 ,  chromium:762967 
Change-Id: I3c6ec9332c5612b7ed811a81957f25c94c80da70
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/21222
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20849}
[modify] https://crrev.com/7bc55b8e84e76c60d55e33c017858d9cb0984225/sdk/android/BUILD.gn

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/648e9a6566e497a173b1a0b2fbf76c0e829163da

commit 648e9a6566e497a173b1a0b2fbf76c0e829163da
Author: Andrew Grieve <agrieve@chromium.org>
Date: Fri Dec 22 20:45:28 2017

Adds an android_aar() target, which can create Android Libraries.

See: https://developer.android.com/studio/projects/android-library.html

webrtc and cronet have both expressed interest in this at one point or
another. While this doesn't support all aar features, it's a good start
(and wasn't that hard).

Bug:  506230 ,  762967 
Change-Id: I1a5144311c1e7a30ccd2a50f77183977d820ea78
Reviewed-on: https://chromium-review.googlesource.com/841862
Commit-Queue: agrieve <agrieve@chromium.org>
Reviewed-by: Eric Stevenson <estevenson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526055}
[add] https://crrev.com/648e9a6566e497a173b1a0b2fbf76c0e829163da/build/android/gyp/dist_aar.py
[modify] https://crrev.com/648e9a6566e497a173b1a0b2fbf76c0e829163da/build/android/gyp/write_build_config.py
[modify] https://crrev.com/648e9a6566e497a173b1a0b2fbf76c0e829163da/build/config/android/internal_rules.gni
[modify] https://crrev.com/648e9a6566e497a173b1a0b2fbf76c0e829163da/build/config/android/rules.gni

Status: Fixed (was: Available)

Sign in to add a comment