Add LOCAL_DONT_DELETE_JAR_META_INF

To support to not delete META_INF directory from the static Java
libraries.

Change-Id: I720bfa059c43dd457a74a0c60bb6797aa408ecaf
This commit is contained in:
Ying Wang 2012-08-30 12:59:42 -07:00
parent 565de5c97c
commit 3a6f7589e8
3 changed files with 5 additions and 2 deletions

View File

@ -125,6 +125,8 @@ LOCAL_ADDRESS_SANITIZER:=
LOCAL_JAR_EXCLUDE_FILES:= LOCAL_JAR_EXCLUDE_FILES:=
LOCAL_LINT_FLAGS:= LOCAL_LINT_FLAGS:=
LOCAL_SOURCE_FILES_ALL_GENERATED:= # '',true LOCAL_SOURCE_FILES_ALL_GENERATED:= # '',true
# Don't delete the META_INF dir when merging static Java libraries.
LOCAL_DONT_DELETE_JAR_META_INF:=
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to # Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
# iterate over thousands of entries every time. # iterate over thousands of entries every time.

View File

@ -1437,8 +1437,8 @@ define unzip-jar-files
exit 1; \ exit 1; \
fi; \ fi; \
unzip -qo $$f -d $(2); \ unzip -qo $$f -d $(2); \
(cd $(2) && rm -rf META-INF); \ done \
done $(if $(PRIVATE_DONT_DELETE_JAR_META_INF),,;rm -rf $(2)/META-INF)
endef endef
# Common definition to invoke javac on the host and target. # Common definition to invoke javac on the host and target.

View File

@ -259,6 +259,7 @@ ALL_MODULES.$(LOCAL_MODULE).STUBS := $(full_classes_stubs_jar)
# via deps on the target that generates the sources. # via deps on the target that generates the sources.
$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS)
$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(LOCAL_JAR_EXCLUDE_FILES) $(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := $(LOCAL_JAR_EXCLUDE_FILES)
$(full_classes_compiled_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_compiled_jar): $(java_sources) $(java_resource_sources) $(full_java_lib_deps) $(jar_manifest_file) \ $(full_classes_compiled_jar): $(java_sources) $(java_resource_sources) $(full_java_lib_deps) $(jar_manifest_file) \
$(RenderScript_file_stamp) $(proto_java_sources_file_stamp) $(RenderScript_file_stamp) $(proto_java_sources_file_stamp)
$(transform-java-to-classes.jar) $(transform-java-to-classes.jar)