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 c1f5d9c203324b9435414e789c02394ca99c98f7)
Bug: 24597504
Change-Id: Iec3b2b0b0e674bee5d80cce3c300dc8fad6e7c13
diff --git a/tools/ijar/Android.mk b/tools/ijar/Android.mk
new file mode 100644
index 0000000..356e109
--- /dev/null
+++ b/tools/ijar/Android.mk
@@ -0,0 +1,14 @@
+# Copyright 2015 The Android Open Source Project
+#
+# The rest of files in this directory comes from
+# https://github.com/bazelbuild/bazel/tree/master/third_party/ijar
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_CPP_EXTENSION := cc
+LOCAL_SRC_FILES := classfile.cc ijar.cc zip.cc
+LOCAL_CFLAGS += -Wall
+LOCAL_SHARED_LIBRARIES := libz-host
+LOCAL_MODULE := ijar
+include $(BUILD_HOST_EXECUTABLE)