summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYohann Roussel <yroussel@google.com>2015-02-05 16:10:58 +0100
committerYohann Roussel <yroussel@google.com>2015-02-18 22:54:18 +0100
commitd2a76c14bf60f45a4bf19721a09a10f758c42a66 (patch)
treece76a61becd8d1050f6ad4c02350f703565cab5b
parent1f382fa4f79dad8be5a7c32ed2a14a65003e661b (diff)
downloadbuild-d2a76c14bf60f45a4bf19721a09a10f758c42a66.tar.gz
build-d2a76c14bf60f45a4bf19721a09a10f758c42a66.tar.bz2
build-d2a76c14bf60f45a4bf19721a09a10f758c42a66.zip
Change built module of static java libraries
Set LOCAL_BUILT_MODULE of static java libraries when Jack is enabled to classes.jack instead of javalib.jar. This allows that running mm in those libraries will build classes.jack instead of the jar. Change-Id: I96b4b227848e971df96331b3f0cc731e856be349
-rw-r--r--core/base_rules.mk7
-rw-r--r--core/configure_local_jack.mk22
-rw-r--r--core/host_dalvik_static_java_library.mk4
-rw-r--r--core/host_java_library.mk6
-rw-r--r--core/host_java_library_common.mk19
-rw-r--r--core/java.mk7
-rw-r--r--core/java_library.mk18
-rw-r--r--core/notice_files.mk2
-rw-r--r--core/package_internal.mk9
-rw-r--r--core/static_java_library.mk4
10 files changed, 70 insertions, 28 deletions
diff --git a/core/base_rules.mk b/core/base_rules.mk
index f33ebf109..6fc5eaf0d 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -43,13 +43,6 @@ endif
my_module_tags := $(LOCAL_MODULE_TAGS)
-LOCAL_JACK_ENABLED := $(strip $(LOCAL_JACK_ENABLED))
-ifneq ($(LOCAL_JACK_ENABLED),full)
-ifneq ($(LOCAL_JACK_ENABLED),incremental)
-LOCAL_JACK_ENABLED :=
-endif
-endif
-
###########################################################
## Validate and define fallbacks for input LOCAL_* variables.
###########################################################
diff --git a/core/configure_local_jack.mk b/core/configure_local_jack.mk
new file mode 100644
index 000000000..159fac4f3
--- /dev/null
+++ b/core/configure_local_jack.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2008 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_JACK_ENABLED := $(strip $(LOCAL_JACK_ENABLED))
+ifneq ($(LOCAL_JACK_ENABLED),full)
+ifneq ($(LOCAL_JACK_ENABLED),incremental)
+LOCAL_JACK_ENABLED :=
+endif
+endif
diff --git a/core/host_dalvik_static_java_library.mk b/core/host_dalvik_static_java_library.mk
index bdce5834e..410b251b0 100644
--- a/core/host_dalvik_static_java_library.mk
+++ b/core/host_dalvik_static_java_library.mk
@@ -21,6 +21,8 @@
#
ifeq ($(HOST_OS),linux)
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_IS_STATIC_JAVA_LIBRARY := true
USE_CORE_LIB_BOOTCLASSPATH := true
LOCAL_JAVA_LIBRARIES += core-libart-hostdex
@@ -51,5 +53,5 @@ $(full_classes_jack): $(java_sources) $(java_resource_sources) $(full_jack_lib_d
$(java-to-jack)
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 b751c5ff3..513d18506 100644
--- a/core/host_java_library.mk
+++ b/core/host_java_library.mk
@@ -58,13 +58,13 @@ endif
$(full_classes_emma_jar) : $(full_classes_compiled_jar) | $(EMMA_JAR)
$(transform-classes.jar-to-emma)
-$(LOCAL_BUILT_MODULE) : $(full_classes_emma_jar)
+$(built_javalib_jar) : $(full_classes_emma_jar)
@echo Copying: $@
$(hide) $(ACP) -fp $< $@
else # LOCAL_EMMA_INSTRUMENT
-# Directly build into LOCAL_BUILT_MODULE.
-full_classes_compiled_jar := $(LOCAL_BUILT_MODULE)
+# Directly build into $(built_javalib_jar).
+full_classes_compiled_jar := $(built_javalib_jar)
endif # LOCAL_EMMA_INSTRUMENT
$(full_classes_compiled_jar): PRIVATE_JAVAC_DEBUG_FLAGS := -g
diff --git a/core/host_java_library_common.mk b/core/host_java_library_common.mk
index cd9e67948..d077634cd 100644
--- a/core/host_java_library_common.mk
+++ b/core/host_java_library_common.mk
@@ -23,6 +23,22 @@ LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
LOCAL_IS_HOST_MODULE := true
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 :=
@@ -39,9 +55,6 @@ else
endif
endif
-intermediates := $(call local-intermediates-dir)
-intermediates.COMMON := $(call local-intermediates-dir,COMMON)
-
LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES))
diff --git a/core/java.mk b/core/java.mk
index f5b5c45e7..6eb224795 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -538,17 +538,14 @@ ifneq ($(GENERATE_DEX_DEBUG),)
endif
findbugs_xml := $(intermediates.COMMON)/findbugs.xml
-$(findbugs_xml) : PRIVATE_JAR_FILE := $(full_classes_jar)
$(findbugs_xml) : PRIVATE_AUXCLASSPATH := $(addprefix -auxclasspath ,$(strip \
$(call normalize-path-list,$(filter %.jar,\
$(full_java_libs)))))
-# We can't depend directly on full_classes_jar because the PRIVATE_
-# vars won't be set up correctly.
-$(findbugs_xml) : $(LOCAL_BUILT_MODULE)
+$(findbugs_xml) : $(full_classes_jar)
@echo Findbugs: $@
$(hide) $(FINDBUGS) -textui -effort:min -xml:withMessages \
$(PRIVATE_AUXCLASSPATH) \
- $(PRIVATE_JAR_FILE) \
+ $< \
> $@
ALL_FINDBUGS_FILES += $(findbugs_xml)
diff --git a/core/java_library.mk b/core/java_library.mk
index 5ba8267fb..5a2d19bff 100644
--- a/core/java_library.mk
+++ b/core/java_library.mk
@@ -24,10 +24,20 @@ endif
LOCAL_BUILT_MODULE_STEM := 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
+endif
+endif
+
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
# This file will be the one that other modules should depend on.
-common_javalib.jar := $(intermediates.COMMON)/$(LOCAL_BUILT_MODULE_STEM)
+common_javalib.jar := $(intermediates.COMMON)/javalib.jar
LOCAL_INTERMEDIATE_TARGETS += $(common_javalib.jar)
ifeq ($(LOCAL_PROGUARD_ENABLED),disabled)
@@ -59,7 +69,11 @@ endif
@echo "target Static Jar: $(PRIVATE_MODULE) ($@)"
$(copy-file-to-target)
-$(LOCAL_BUILT_MODULE): $(common_javalib.jar)
+ifdef LOCAL_JACK_ENABLED
+$(LOCAL_BUILT_MODULE) : $(full_classes_jack)
+else
+$(LOCAL_BUILT_MODULE) : $(common_javalib.jar)
+endif
$(copy-file-to-target)
else # !LOCAL_IS_STATIC_JAVA_LIBRARY
diff --git a/core/notice_files.mk b/core/notice_files.mk
index e63cd84b5..43a543527 100644
--- a/core/notice_files.mk
+++ b/core/notice_files.mk
@@ -43,7 +43,7 @@ else
# javalib.jar is the default name for the build module (and isn't meaningful)
# If that's what we have, substitute the module name instead. These files
# aren't included on the device, so this name is synthetic anyway.
- ifeq ($(module_leaf),javalib.jar)
+ ifneq ($(filter javalib.jar classes.jack,$(module_leaf)),)
module_leaf := $(LOCAL_MODULE).jar
endif
module_installed_filename := \
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 3c488f63b..40669a0b3 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -57,12 +57,9 @@ $(error $(LOCAL_PATH): Package modules may not set LOCAL_MODULE_CLASS)
endif
LOCAL_MODULE_CLASS := APPS
-LOCAL_JACK_ENABLED := $(strip $(LOCAL_JACK_ENABLED))
-ifneq ($(LOCAL_JACK_ENABLED),full)
-ifneq ($(LOCAL_JACK_ENABLED),incremental)
-LOCAL_JACK_ENABLED :=
-endif
-endif
+#################################
+include $(BUILD_SYSTEM)/configure_local_jack.mk
+#################################
# Package LOCAL_MODULE_TAGS default to optional
LOCAL_MODULE_TAGS := $(strip $(LOCAL_MODULE_TAGS))
diff --git a/core/static_java_library.mk b/core/static_java_library.mk
index c5d1b4660..9b7b46a4a 100644
--- a/core/static_java_library.mk
+++ b/core/static_java_library.mk
@@ -59,6 +59,10 @@ endif
LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS)
+#################################
+include $(BUILD_SYSTEM)/configure_local_jack.mk
+#################################
+
ifdef LOCAL_JACK_ENABLED
ifndef LOCAL_JACK_PROGUARD_FLAGS
LOCAL_JACK_PROGUARD_FLAGS := $(LOCAL_PROGUARD_FLAGS)