Switch from jarjar to generated source for ICU4J
Future changes will include ICU4J classes as public APIs
(still beneath android.icu). To generate these docs source
code will be needed under the expected package (android.icu),
as well as the ability to apply changes to the javadoc
comments programatically so ICU can be upgraded easily.
A consequence of this change is that libcore code can now
depend on icu in the android.icu package and not the
com.ibm.icu package as was the case previously. A nice
side effect is that the source code is available for use
during debugging as well.
Bug: 22023363
Change-Id: Icba5668fae53e2dc98ccc74e2f1ad1ca226e5feb
diff --git a/JavaLibrary.mk b/JavaLibrary.mk
index 7cb1829..65663cd 100644
--- a/JavaLibrary.mk
+++ b/JavaLibrary.mk
@@ -71,29 +71,11 @@
#
# ICU4J related rules.
#
-# We compile icu4j along with core-libart because we're implementing parts of core-libart
-# in terms of icu4j.
-icu4j_root := ../external/icu/icu4j/
-icu4j_src_files := $(call all-java-files-under,$(icu4j_root)/main/classes)
-
-# Filter out bits of ICU4J we don't use yet : the SPIs (which we have limited support for),
-# and the charset encoders
-icu4j_src_files := $(filter-out $(icu4j_root)/main/classes/localespi/%, $(icu4j_src_files))
-icu4j_src_files := $(filter-out $(icu4j_root)/main/classes/charset/%, $(icu4j_src_files))
-
-# Not all src dirs contain resources, some instead contain other random files
-# that should not be included as resources. The ones that should be included
-# can be identifed by the fact that they contain particular subdir trees.
-#
-define all-icu-subdir-with-subdir
-$(patsubst $(LOCAL_PATH)/%/$(2),%,$(wildcard $(LOCAL_PATH)/$(1)/$(2)))
-endef
-
-icu4j_resource_dirs := $(call all-icu-subdir-with-subdir,$(icu4j_root)/main/classes/*/src,com/ibm/icu)
-icu4j_resource_dirs := $(filter-out $(icu4j_root)/main/classes/localespi/%, $(icu4j_resource_dirs))
-icu4j_resource_dirs := $(filter-out $(icu4j_root)/main/classes/charset/%, $(icu4j_resource_dirs))
-
-
+# We compile android_icu4j along with core-libart because we're implementing parts of core-libart
+# in terms of android_icu4j.
+android_icu4j_root := ../external/icu/android_icu4j/
+android_icu4j_src_files := $(call all-java-files-under,$(android_icu4j_root)/src)
+android_icu4j_resource_dirs := $(android_icu4j_root)/resources
#
# Build for the target (device).
@@ -102,8 +84,8 @@
# Definitions to make the core library.
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(libart_core_src_files) $(icu4j_src_files)
-LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) $(icu4j_resource_dirs)
+LOCAL_SRC_FILES := $(libart_core_src_files) $(android_icu4j_src_files)
+LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) $(android_icu4j_resource_dirs)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVACFLAGS := $(local_javac_flags)
LOCAL_DX_FLAGS := --core-library
@@ -111,7 +93,6 @@
LOCAL_MODULE := core-libart
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
LOCAL_REQUIRED_MODULES := tzdata
-LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
include $(BUILD_JAVA_LIBRARY)
ifeq ($(LIBCORE_SKIP_TESTS),)
@@ -162,8 +143,8 @@
# Definitions to make the core library.
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(libart_core_src_files) $(icu4j_src_files)
-LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) $(icu4j_resource_dirs)
+LOCAL_SRC_FILES := $(libart_core_src_files) $(android_icu4j_src_files)
+LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs) $(android_icu4j_resource_dirs)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVACFLAGS := $(local_javac_flags)
LOCAL_DX_FLAGS := --core-library
@@ -171,7 +152,6 @@
LOCAL_MODULE := core-libart-hostdex
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk
LOCAL_REQUIRED_MODULES := tzdata-host
-LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
# Make the core-tests library.
@@ -231,7 +211,6 @@
LOCAL_SRC_FILES := $(libcore_to_document)
# rerun doc generation without recompiling the java
-LOCAL_JAVA_LIBRARIES:= icu4j # ICU is needed to resolve some constants in public libcore.
LOCAL_JAVACFLAGS := $(local_javac_flags)
LOCAL_MODULE_CLASS:=JAVA_LIBRARIES