Merge "Automatically add Java resources carried by static Java libraries."
This commit is contained in:
commit
939c427de2
4 changed files with 18 additions and 1 deletions
|
@ -1480,7 +1480,6 @@ endef
|
|||
define transform-java-to-classes.jar
|
||||
@echo "target Java: $(PRIVATE_MODULE) ($(PRIVATE_CLASS_INTERMEDIATES_DIR))"
|
||||
$(call compile-java,$(TARGET_JAVAC),$(PRIVATE_BOOTCLASSPATH))
|
||||
$(hide) rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR)
|
||||
endef
|
||||
|
||||
# Override the above definitions if we want to do incremetal javac
|
||||
|
@ -1613,12 +1612,27 @@ cp $(PRIVATE_DEX_FILE) $$_adtp_classes_dex && \
|
|||
$(AAPT) add -k $@ $$_adtp_classes_dex && rm -f $$_adtp_classes_dex)
|
||||
endef
|
||||
|
||||
# Add java resources added by the current module.
|
||||
#
|
||||
define add-java-resources-to-package
|
||||
$(call dump-words-to-file, $(PRIVATE_EXTRA_JAR_ARGS), $(dir $@)jar-arg-list)
|
||||
$(hide) jar uf $@ @$(dir $@)jar-arg-list
|
||||
@rm -f $(dir $@)jar-arg-list
|
||||
endef
|
||||
|
||||
# Add java resources carried by static Java libraries.
|
||||
#
|
||||
define add-carried-java-resources
|
||||
$(hide) if [ -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) ] ; then \
|
||||
java_res_jar_flags=$$(find $(PRIVATE_CLASS_INTERMEDIATES_DIR) -type f -a -not -name "*.class" \
|
||||
| sed -e "s?^$(PRIVATE_CLASS_INTERMEDIATES_DIR)/? -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) ?"); \
|
||||
if [ -n "$$java_res_jar_flags" ] ; then \
|
||||
echo $$java_res_jar_flags >$(dir $@)java_res_jar_flags; \
|
||||
jar uf $@ $$java_res_jar_flags; \
|
||||
fi; \
|
||||
fi
|
||||
endef
|
||||
|
||||
# Sign a package using the specified key/cert.
|
||||
#
|
||||
define sign-package
|
||||
|
|
|
@ -82,6 +82,7 @@ $(LOCAL_BUILT_MODULE): $(built_dex) $(java_resource_sources) | $(AAPT)
|
|||
@echo "Host Jar: $(PRIVATE_MODULE) ($@)"
|
||||
$(create-empty-package)
|
||||
$(add-dex-to-package)
|
||||
$(add-carried-java-resources)
|
||||
ifneq ($(extra_jar_args),)
|
||||
$(add-java-resources-to-package)
|
||||
endif
|
||||
|
|
|
@ -67,6 +67,7 @@ $(common_javalib.jar) : $(built_dex) $(java_resource_sources) | $(AAPT)
|
|||
@echo "target Jar: $(PRIVATE_MODULE) ($@)"
|
||||
$(create-empty-package)
|
||||
$(add-dex-to-package)
|
||||
$(add-carried-java-resources)
|
||||
ifneq ($(extra_jar_args),)
|
||||
$(add-java-resources-to-package)
|
||||
endif
|
||||
|
|
|
@ -376,6 +376,7 @@ endif
|
|||
ifneq ($(full_classes_jar),)
|
||||
$(add-dex-to-package)
|
||||
endif
|
||||
$(add-carried-java-resources)
|
||||
ifneq ($(extra_jar_args),)
|
||||
$(add-java-resources-to-package)
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue