Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files

The same optimization was done for binaries in

https://android-review.googlesource.com/#/c/175250/

To create a TOC file from .jar files, this change introduces
ijar, which is designed for this purpose. Only #include lines
were modified from the original version.

https://github.com/bazelbuild/bazel/tree/master/third_party/ijar

Performance:

$ m && touch
frameworks/base/core/java/com/google/android/util/Procedure.java && time
m
Before: 4m30s (1580 targets)
After: 3m57s (772 targets)

Unfortunately, the improvement is small yet, but local
experiments showed we can cut ~2 more minutes if the similar
optimization is done for .dex files.

(cherry picked from commit c1f5d9c203)

Bug: 24597504
Change-Id: Iec3b2b0b0e674bee5d80cce3c300dc8fad6e7c13
This commit is contained in:
Shinichiro Hamaji
2015-11-09 16:47:42 +09:00
committed by Colin Cross
parent 2ff3ad9045
commit 89b255ab71
15 changed files with 3973 additions and 13 deletions

View File

@@ -456,6 +456,8 @@ $(full_classes_jar): $(full_classes_emma_jar) | $(ACP)
@echo Copying: $@
$(hide) $(ACP) -fp $< $@
$(call define-jar-to-toc-rule, $(full_classes_jar))
# Run proguard if necessary, otherwise just copy the file.
ifdef LOCAL_PROGUARD_ENABLED
ifneq ($(filter-out full custom nosystem obfuscation optimization shrinktests,$(LOCAL_PROGUARD_ENABLED)),)