New issue
Advanced search Search tips

Issue 620053 link

Starred by 10 users

Issue metadata

Status: WontFix
Owner:
Closed: Mar 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocked on:
issue 662467

Blocking:
issue 617657
issue 536817



Sign in to add a comment

Add support for compiling with Jack

Project Member Reported by agrieve@chromium.org, Jun 14 2016

Issue description

https://source.android.com/source/jack.html

Why we'd want to use jack:
- Support for Java 8
- Support for asserts (as well as stripping them in release)
- Faster compiles (well... we'll see anyways :P)
- Potentially more optimized .dex files

It's been shipping with the Android SDK for a while, and lives at: 
//third_party/android_tools/sdk/build-tools/23.0.1/jack.jar
//third_party/android_tools/sdk/build-tools/23.0.1/jill.jar


Note: Adding support for jack would not meen dropping support for javac. We still need javac for:
1. Findbugs, lint, (errorprone?) require .jars
2. Our Eclipse setup uses .jars for our generated files
3. Instrumentation tests use a .jar to extract the test list
4. Robolectric tests

#3 we could certainly find another way around, but the others all seem quite compelling.

Also - we need intermediate .dex files for _incremental targets, but we could produce them from .jack files rather than .jars if we wanted.


Proposed implementation:

Phase 1 (debug):
* Add a use_jack GN arg that would:
  * Invoke jack at the same time as javac when compiling from source
  * Use jack+jill to for android_prebuilt() targets
  * Use jack for final classes.dex assembly

Phase 2 (release):
 * Have our final proguard step use the .jack files rather than the .jar files

For both phases, we'll still use .interface.jar files to know when dependencies have changed meaningfully.
 
Issue 441817 has been merged into this issue.
Blocking: 462676
Cc: jbudorick@chromium.org
Learned recently that we don't actually need Jack for Java 8 features. We could instead use https://github.com/orfjackal/retrolambda.

Likewise, this gradle plugin shows how to enable assertions using javassist (compile-time bytecode manipulation):
https://github.com/gfx/android-power-assert-plugin/blob/master/plugin/src/main/groovy/com/github/gfx/android/powerassert/Empower.groovy#L129


I think we're going to have to move to Jack regardless, and so I'm not sure how productive it is to pull in other repos as workarounds in the interim.
Blocking: -462676
So I was looking at steps to update the SDK and noticed this was still open.  Do we plan to fix it at any point?
Blockedon: 662467
Not on my radar yet, but certainly "at some point" I'd like to see this happen.
Status: WontFix (was: Assigned)
Luckily (?) I don't think anyone ever got around to looking in to this too much.

Sign in to add a comment