diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk index 8140af681..e1720181e 100644 --- a/core/host_dalvik_java_library.mk +++ b/core/host_dalvik_java_library.mk @@ -23,37 +23,35 @@ ifeq ($(HOST_OS),linux) USE_CORE_LIB_BOOTCLASSPATH := true +################################# +include $(BUILD_SYSTEM)/configure_local_jack.mk +################################# + ####################################### include $(BUILD_SYSTEM)/host_java_library_common.mk ####################################### +ifeq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true) + # For static library, $(LOCAL_BUILT_MODULE) is $(full_classes_jack). + LOCAL_BUILT_MODULE_STEM := classes.jack +endif ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) LOCAL_JAVA_LIBRARIES += core-oj-hostdex LOCAL_JAVA_LIBRARIES += core-libart-hostdex endif -full_classes_compiled_jar := $(intermediates.COMMON)/classes-full-debug.jar -full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar -full_classes_jar := $(intermediates.COMMON)/classes.jar full_classes_jack := $(intermediates.COMMON)/classes.jack jack_check_timestamp := $(intermediates.COMMON)/jack.check.timestamp built_dex := $(intermediates.COMMON)/classes.dex LOCAL_INTERMEDIATE_TARGETS += \ - $(full_classes_compiled_jar) \ - $(full_classes_jarjar_jar) \ $(full_classes_jack) \ - $(full_classes_jar) \ $(jack_check_timestamp) \ $(built_dex) # See comment in java.mk ifndef LOCAL_CHECKED_MODULE -ifdef LOCAL_JACK_ENABLED LOCAL_CHECKED_MODULE := $(jack_check_timestamp) -else -LOCAL_CHECKED_MODULE := $(full_classes_compiled_jar) -endif endif ####################################### @@ -65,64 +63,17 @@ all_java_sources := $(java_sources) include $(BUILD_SYSTEM)/java_common.mk -# The layers file allows you to enforce a layering between java packages. -# Run build/tools/java-layers.py for more details. -layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE)) - $(cleantarget): PRIVATE_CLEAN_FILES += $(intermediates.COMMON) -$(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file) -$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JAVACFLAGS) -$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_FILES := -$(full_classes_compiled_jar): PRIVATE_JAR_PACKAGES := -$(full_classes_compiled_jar): PRIVATE_JAR_EXCLUDE_PACKAGES := -$(full_classes_compiled_jar): \ - $(java_sources) \ - $(java_resource_sources) \ - $(full_java_lib_deps) \ - $(jar_manifest_file) \ - $(proto_java_sources_file_stamp) \ - $(LOCAL_ADDITIONAL_DEPENDENCIES) - $(transform-host-java-to-package) - -javac-check : $(full_classes_compiled_jar) - -# Run jarjar if necessary, otherwise just copy the file. -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) $< $@ -else -$(full_classes_jarjar_jar): $(full_classes_compiled_jar) | $(ACP) - @echo Copying: $@ - $(hide) $(ACP) -fp $< $@ -endif - -$(full_classes_jar): $(full_classes_jarjar_jar) | $(ACP) - @echo Copying: $@ - $(hide) $(ACP) -fp $< $@ - -ifndef LOCAL_JACK_ENABLED - -$(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(built_dex) -$(LOCAL_BUILT_MODULE): PRIVATE_SOURCE_ARCHIVE := $(full_classes_jarjar_jar) -$(LOCAL_BUILT_MODULE): PRIVATE_DONT_DELETE_JAR_DIRS := $(LOCAL_DONT_DELETE_JAR_DIRS) -$(LOCAL_BUILT_MODULE): $(built_dex) $(java_resource_sources) - @echo "Host Jar: $(PRIVATE_MODULE) ($@)" - $(call initialize-package-file,$(PRIVATE_SOURCE_ARCHIVE),$@) - $(add-dex-to-package) - -else # LOCAL_JACK_ENABLED $(LOCAL_INTERMEDIATE_TARGETS): \ - PRIVATE_JACK_INTERMEDIATES_DIR := $(intermediates.COMMON)/jack-rsc + PRIVATE_JACK_INTERMEDIATES_DIR := $(intermediates.COMMON)/jack-rsc ifeq ($(LOCAL_JACK_ENABLED),incremental) $(LOCAL_INTERMEDIATE_TARGETS): \ - PRIVATE_JACK_INCREMENTAL_DIR := $(intermediates.COMMON)/jack-incremental + PRIVATE_JACK_INCREMENTAL_DIR := $(intermediates.COMMON)/jack-incremental else $(LOCAL_INTERMEDIATE_TARGETS): \ - PRIVATE_JACK_INCREMENTAL_DIR := + PRIVATE_JACK_INCREMENTAL_DIR := endif $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION) @@ -131,15 +82,13 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_MIN_SDK_VERSION := $(PLATFORM_JACK_M jack_all_deps := $(java_sources) $(java_resource_sources) $(full_jack_deps) \ $(jar_manifest_file) $(proto_java_sources_file_stamp) \ $(LOCAL_ADDITIONAL_DEPENDENCIES) $(JACK) + +ifneq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true) $(built_dex): PRIVATE_CLASSES_JACK := $(full_classes_jack) $(built_dex): $(jack_all_deps) | setup-jack-server @echo Building with Jack: $@ $(jack-java-to-dex) -$(jack_check_timestamp): $(jack_all_deps) | setup-jack-server - @echo Checking build with Jack: $@ - $(jack-check-java) - # $(full_classes_jack) is just by-product of $(built_dex). # The dummy command was added because, without it, make misses the fact the $(built_dex) also # change $(full_classes_jack). @@ -153,7 +102,16 @@ $(LOCAL_BUILT_MODULE): $(built_dex) $(java_resource_sources) $(add-dex-to-package) $(add-carried-jack-resources) -endif # LOCAL_JACK_ENABLED +else # LOCAL_IS_STATIC_JAVA_LIBRARY +$(full_classes_jack): $(jack_all_deps) | setup-jack-server + @echo Building with Jack: $@ + $(java-to-jack) + +endif # LOCAL_IS_STATIC_JAVA_LIBRARY + +$(jack_check_timestamp): $(jack_all_deps) | setup-jack-server + @echo Checking build with Jack: $@ + $(jack-check-java) USE_CORE_LIB_BOOTCLASSPATH := diff --git a/core/host_dalvik_static_java_library.mk b/core/host_dalvik_static_java_library.mk index d1c0835ad..46b824079 100644 --- a/core/host_dalvik_static_java_library.mk +++ b/core/host_dalvik_static_java_library.mk @@ -19,43 +19,10 @@ # These libraries will be compiled against libcore and not the host # JRE. # -ifeq ($(HOST_OS),linux) - LOCAL_UNINSTALLABLE_MODULE := true LOCAL_IS_STATIC_JAVA_LIBRARY := true -USE_CORE_LIB_BOOTCLASSPATH := true -LOCAL_JAVA_LIBRARIES += core-oj-hostdex -LOCAL_JAVA_LIBRARIES += core-libart-hostdex -intermediates.COMMON := $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE),true,COMMON,) -full_classes_jack := $(intermediates.COMMON)/classes.jack -LOCAL_INTERMEDIATE_TARGETS += \ - $(full_classes_jack) - -include $(BUILD_SYSTEM)/host_java_library.mk -# proguard is not supported -# *.proto files are not supported -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_FLAGS := $(GLOBAL_JAVAC_DEBUG_FLAGS) $(LOCAL_JACK_FLAGS) -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION) -$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_MIN_SDK_VERSION := $(PLATFORM_JACK_MIN_SDK_VERSION) - -$(full_classes_jack): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES) -$(full_classes_jack): \ - PRIVATE_JACK_INTERMEDIATES_DIR := $(intermediates.COMMON)/jack-rsc -ifeq ($(LOCAL_JACK_ENABLED),incremental) -$(full_classes_jack): \ - PRIVATE_JACK_INCREMENTAL_DIR := $(intermediates.COMMON)/jack-incremental -else -$(full_classes_jack): \ - PRIVATE_JACK_INCREMENTAL_DIR := -endif -$(full_classes_jack): $(java_sources) $(java_resource_sources) $(full_jack_deps) \ - $(jar_manifest_file) $(layers_file) \ - $(LOCAL_ADDITIONAL_DEPENDENCIES) $(LOCAL_JARJAR_RULES) \ - $(JACK) | setup-jack-server - @echo Building with Jack: $@ - $(java-to-jack) +include $(BUILD_SYSTEM)/host_dalvik_java_library.mk USE_CORE_LIB_BOOTCLASSPATH := LOCAL_IS_STATIC_JAVA_LIBRARY := -endif diff --git a/core/host_java_library.mk b/core/host_java_library.mk index b5c5e9eea..0d71c01ee 100644 --- a/core/host_java_library.mk +++ b/core/host_java_library.mk @@ -98,12 +98,12 @@ endif $(full_classes_emma_jar) : $(full_classes_jarjar_jar) | $(EMMA_JAR) $(transform-classes.jar-to-emma) -$(built_javalib_jar) : $(full_classes_emma_jar) +$(LOCAL_BUILT_MODULE) : $(full_classes_emma_jar) @echo Copying: $@ $(hide) $(ACP) -fp $< $@ else # LOCAL_EMMA_INSTRUMENT -$(built_javalib_jar): $(full_classes_jarjar_jar) | $(ACP) +$(LOCAL_BUILT_MODULE) : $(full_classes_jarjar_jar) | $(ACP) @echo Copying: $@ $(hide) $(ACP) -fp $< $@ endif # LOCAL_EMMA_INSTRUMENT diff --git a/core/host_java_library_common.mk b/core/host_java_library_common.mk index 35a6e28ed..8df4b37ab 100644 --- a/core/host_java_library_common.mk +++ b/core/host_java_library_common.mk @@ -26,19 +26,6 @@ LOCAL_BUILT_MODULE_STEM := javalib.jar intermediates := $(call local-intermediates-dir) intermediates.COMMON := $(call local-intermediates-dir,COMMON) -built_javalib_jar := $(intermediates)/javalib.jar - -################################# -include $(BUILD_SYSTEM)/configure_local_jack.mk -################################# - -ifdef LOCAL_JACK_ENABLED -ifdef LOCAL_IS_STATIC_JAVA_LIBRARY -LOCAL_BUILT_MODULE_STEM := classes.jack -LOCAL_INTERMEDIATE_TARGETS += $(built_javalib_jar) -endif -endif - # base_rules.mk looks at this all_res_assets := @@ -61,4 +48,3 @@ endif LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES)) -