blob: 5de7a21949b660eb2b5f941688115598457073e0 [file] [log] [blame]
Name: Desugar, transforming Java 8 bytecode to be Java 7 compatible
Short Name: desugar
URL: https://github.com/bazelbuild/bazel
Version: 1.1.0
License: Apache 2.0
Security Critical: no
Description:
Desugar is a Google-developed open-source Java library used by the build process
to transform Java 8 bytecode to Java 7. It is used to enable Java 8 features
such as lambda experssions for Chrome on Android.
Googlers: See: go/desugar
Local Modifications:
* Added BUILD.gn, proguard.flags.
* Made all lambdas be "stateful" to avoid <clinit> bloat.
* Desugar_deploy.jar split into Desugar.jar and Desugar_runtime.jar.
* Desugar.jar has been run through r8.jar to remove unused .class files.
Update instructions (requires @google.com account for uploading):
* Check out Bazel from https://github.com/bazelbuild/bazel
* Compile or install Bazel by following instructions on
https://docs.bazel.build/versions/master/install.html
* Apply stateful-lambdas.patch:
git apply $CHROMIUM_SRC/third_party/bazel/desugar/stateful-lambdas.patch
* Build Desugar_deploy.jar:
bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_deploy.jar
* Move Desugar_deploy.jar to location within Chromium:
rm $CHROMIUM_SRC/third_party/bazel/desugar/Desugar.jar
mv bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/Desugar_deploy.jar $CHROMIUM_SRC/third_party/bazel/desugar/Desugar.jar
* Update Desugar_runtime.jar:
unzip Desugar.jar "com/google/devtools/build/android/desugar/runtime*"
zip -rD0 Desugar_runtime.jar com
rm -r com
* Shrink via r8 (optional - reduces size by about 66%).
java -jar ../../r8/lib/r8.jar --debug --classfile --output Desugar.new.jar --pg-conf proguard.flags --no-desugaring --lib ../../jdk/extras/java_8/jre/lib/rt.jar Desugar.jar
mv Desugar.new.jar Desugar.jar
* Perform a sanity check of chrome_public_apk:
ninja chrome_public_apk
bin/chrome_public_apk run
* Update this README.chromium (Version)
* Upload new jar to CIPD:
cd third_party/bazel
cipd create --pkg-def cipd.yaml
* Update revision //DEPS