Merge "Provide make variables for java binaries"

This commit is contained in:
Treehugger Robot 2017-07-01 01:25:10 +00:00 committed by Gerrit Code Review
commit 5e19557eb9
11 changed files with 25 additions and 21 deletions

View File

@ -1093,7 +1093,7 @@ $(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) $(extra_keys)
@echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys)"
@rm -rf $@
@mkdir -p $(dir $@)
java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys) > $@
$(JAVA) -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys) > $@
RECOVERYIMAGE_ID_FILE := $(PRODUCT_OUT)/recovery.id

View File

@ -23,6 +23,10 @@ else
JAVACC := $(ALTERNATE_JAVAC)
endif
JAVA := java
JAVADOC := javadoc
JAR := jar
# The actual compiler can be wrapped by setting the JAVAC_WRAPPER var.
ifdef JAVAC_WRAPPER
ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC)))

View File

@ -517,7 +517,7 @@ DX := $(HOST_OUT_EXECUTABLES)/dx
DX_COMMAND := $(DX) -JXms16M -JXmx2048M
else
DX := $(DX_ALT_JAR)
DX_COMMAND := java -Xms16M -Xmx2048M -jar $(DX)
DX_COMMAND := $(JAVA) -Xms16M -Xmx2048M -jar $(DX)
endif
MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses
@ -676,7 +676,7 @@ FINDBUGS := $(FINDBUGS_DIR)/findbugs
EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX)
# Tool to merge AndroidManifest.xmls
ANDROID_MANIFEST_MERGER := java -classpath prebuilts/devtools/tools/lib/manifest-merger.jar com.android.manifmerger.Main merge
ANDROID_MANIFEST_MERGER := $(JAVA) -classpath prebuilts/devtools/tools/lib/manifest-merger.jar com.android.manifmerger.Main merge
COLUMN:= column
@ -700,7 +700,7 @@ endif # ifeq ($(EXPERIMENTAL_USE_OPENJDK9),)
# Is the host JDK 64-bit version?
HOST_JDK_IS_64BIT_VERSION :=
ifneq ($(filter 64-Bit, $(shell java -version 2>&1)),)
ifneq ($(filter 64-Bit, $(shell $(JAVA) -version 2>&1)),)
HOST_JDK_IS_64BIT_VERSION := true
endif
endif # CALLED_FROM_SETUP not true

View File

@ -2243,9 +2243,9 @@ $(if $(PRIVATE_JAR_EXCLUDE_PACKAGES), $(hide) rm -rf \
$(if $(PRIVATE_JAR_MANIFEST), \
$(hide) sed -e "s/%BUILD_NUMBER%/$(BUILD_NUMBER_FROM_FILE)/" \
$(PRIVATE_JAR_MANIFEST) > $(dir $@)/manifest.mf && \
jar -cfm $@ $(dir $@)/manifest.mf \
$(JAR) -cfm $@ $(dir $@)/manifest.mf \
-C $(PRIVATE_CLASS_INTERMEDIATES_DIR) ., \
$(hide) jar -cf $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) .)
$(hide) $(JAR) -cf $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) .)
$(if $(PRIVATE_EXTRA_JAR_ARGS),$(call add-java-resources-to,$@))
endef
@ -2516,7 +2516,7 @@ $(if $(PRIVATE_JAR_MANIFEST), $(hide) echo unsupported options JAR_MANIFEST in $
endef
define transform-classes.jar-to-emma
$(hide) java -classpath $(EMMA_JAR) emma instr -outmode fullcopy -outfile \
$(hide) $(JAVA) -classpath $(EMMA_JAR) emma instr -outmode fullcopy -outfile \
$(PRIVATE_EMMA_COVERAGE_FILE) -ip $< -d $(PRIVATE_EMMA_INTERMEDIATES_DIR) \
$(addprefix -ix , $(PRIVATE_EMMA_COVERAGE_FILTER))
endef
@ -2539,7 +2539,7 @@ define desugar-classes-jar
$(hide) rm -f $@ $@.tmp
@rm -rf $(dir $@)/desugar_dumped_classes
@mkdir $(dir $@)/desugar_dumped_classes
$(hide) java \
$(hide) $(JAVA) \
$(if $(EXPERIMENTAL_USE_OPENJDK9),--add-opens java.base/java.lang.invoke=ALL-UNNAMED,) \
-Djdk.internal.lambda.dumpProxyClasses=$(abspath $(dir $@))/desugar_dumped_classes \
-jar $(DESUGAR) \
@ -2577,7 +2577,7 @@ endef
define create-empty-package-at
@mkdir -p $(dir $(1))
$(hide) touch $(dir $(1))zipdummy
$(hide) (cd $(dir $(1)) && jar cf $(notdir $(1)) zipdummy)
$(hide) $(JAR) cf $(1) -C $(dir $(1)) zipdummy
$(hide) zip -qd $(1) zipdummy
$(hide) rm $(dir $(1))zipdummy
endef
@ -2671,7 +2671,7 @@ endef
#
define add-java-resources-to
$(call dump-words-to-file, $(PRIVATE_EXTRA_JAR_ARGS), $(1).jar-arg-list)
$(hide) jar uf $(1) @$(1).jar-arg-list
$(hide) $(JAR) uf $(1) @$(1).jar-arg-list
@rm -f $(1).jar-arg-list
endef
@ -2683,7 +2683,7 @@ define add-carried-jack-resources
| sed -e "s?^$(PRIVATE_JACK_INTERMEDIATES_DIR)/? -C \"$(PRIVATE_JACK_INTERMEDIATES_DIR)\" \"?" -e "s/$$/\"/" \
> $(dir $@)jack_res_jar_flags; \
if [ -s $(dir $@)jack_res_jar_flags ] ; then \
jar uf $@ @$(dir $@)jack_res_jar_flags; \
$(JAR) uf $@ @$(dir $@)jack_res_jar_flags; \
fi; \
fi
endef
@ -2698,7 +2698,7 @@ endef
# $(1): the package file we are signing.
define sign-package-arg
$(hide) mv $(1) $(1).unsigned
$(hide) java -Djava.library.path=$(SIGNAPK_JNI_LIBRARY_PATH) \
$(hide) $(JAVA) -Djava.library.path=$(SIGNAPK_JNI_LIBRARY_PATH) \
$(if $(EXPERIMENTAL_USE_OPENJDK9),--add-exports java.base/sun.security.pkcs=ALL-UNNAMED,) \
$(if $(EXPERIMENTAL_USE_OPENJDK9),--add-exports java.base/sun.security.x509=ALL-UNNAMED,) \
-jar $(SIGNAPK_JAR) \

View File

@ -179,7 +179,7 @@ $(full_target): \
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(hide) ( \
javadoc \
$(JAVADOC) \
-encoding UTF-8 \
-source 1.8 \
\@$(PRIVATE_SRC_LIST_FILE) \
@ -216,7 +216,7 @@ $(full_target): $(full_src_files) $(full_java_lib_deps)
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(hide) ( \
javadoc \
$(JAVADOC) \
-encoding UTF-8 \
$(PRIVATE_DROIDDOC_OPTIONS) \
\@$(PRIVATE_SRC_LIST_FILE) \

View File

@ -119,7 +119,7 @@ ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
$(full_classes_jarjar_jar): $(full_classes_desugar_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR)
@echo JarJar: $@
$(hide) java -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
$(hide) $(JAVA) -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
else
full_classes_jarjar_jar := $(full_classes_desugar_jar)
endif

View File

@ -90,7 +90,7 @@ ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
$(full_classes_jarjar_jar): $(full_classes_compiled_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR)
@echo JarJar: $@
$(hide) java -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
$(hide) $(JAVA) -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
else
full_classes_jarjar_jar := $(full_classes_compiled_jar)
endif

View File

@ -463,7 +463,7 @@ out :=
$(full_classes_processed_jar): $(full_classes_compiled_jar) $(LOCAL_JAR_PROCESSOR)
@echo Processing $@ with $(PRIVATE_JAR_PROCESSOR)
$(hide) rm -f $@ $(PRIVATE_TMP_OUT)
$(hide) java -jar $(PRIVATE_JAR_PROCESSOR) $(PRIVATE_JAR_PROCESSOR_ARGS)
$(hide) $(JAVA) -jar $(PRIVATE_JAR_PROCESSOR) $(PRIVATE_JAR_PROCESSOR_ARGS)
$(hide) mv $(PRIVATE_TMP_OUT) $@
else
@ -489,7 +489,7 @@ ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
$(full_classes_jarjar_jar): $(full_classes_desugar_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR)
@echo JarJar: $@
$(hide) java -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
$(hide) $(JAVA) -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
else
full_classes_jarjar_jar := $(full_classes_desugar_jar)
endif

View File

@ -355,7 +355,7 @@ $(data_binding_stamp) : $(all_res_assets) $(full_android_manifest) \
@rm -rf $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) && \
mkdir -p $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) \
$(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_ANNO_SRC_DIR)
$(hide) java -classpath $(DATA_BINDING_COMPILER) android.databinding.tool.MakeCopy \
$(hide) $(JAVA) -classpath $(DATA_BINDING_COMPILER) android.databinding.tool.MakeCopy \
$(PRIVATE_MANIFEST) $(PRIVATE_SRC_OUT) $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_RES_IN)
$(hide) touch $@

View File

@ -199,7 +199,7 @@ $(built_aar) : $(full_classes_jar) $(full_android_manifest)
# Note: Use "cp -n" to honor the resource overlay rules, if multiple res dirs exist.
$(hide) $(foreach res,$(PRIVATE_RESOURCE_DIR),cp -Rfn $(res)/* $(dir $@)aar/res;)
$(hide) cp $(PRIVATE_R_TXT) $(dir $@)aar/R.txt
$(hide) jar -cMf $@ \
$(hide) $(JAR) -cMf $@ \
-C $(dir $@)aar .
# Register the aar file.

View File

@ -35,7 +35,7 @@ endef
define stub-addon-jar
$(call stub-addon-jar-file,$(1)): $(1) | mkstubs
$(info Stubbing addon jar using $(PRODUCT_SDK_ADDON_STUB_DEFS))
$(hide) java -jar $(call module-installed-files,mkstubs) $(if $(hide),,--v) \
$(hide) $(JAVA) -jar $(call module-installed-files,mkstubs) $(if $(hide),,--v) \
"$$<" "$$@" @$(PRODUCT_SDK_ADDON_STUB_DEFS)
endef