Add support for compiling with Jack |
|||||
Issue descriptionhttps://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.
,
Jun 14 2016
,
Jun 14 2016
,
Aug 9 2016
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
,
Aug 9 2016
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.
,
Aug 31 2016
,
Dec 13 2016
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?
,
Dec 14 2016
,
Mar 15 2017
jack is now deprecated? https://android-developers.googleblog.com/2017/03/future-of-java-8-language-feature.html
,
Mar 15 2017
Luckily (?) I don't think anyone ever got around to looking in to this too much. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by agrieve@chromium.org
, Jun 14 2016