Merge "Switch from jack to javac for unbundled builds"
diff --git a/core/Makefile b/core/Makefile
index 095f149..4b15f3c 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1191,7 +1191,8 @@
@echo Modifying ramdisk contents...
$(if $(BOARD_RECOVERY_KERNEL_MODULES), \
$(call build-image-kernel-modules,$(BOARD_RECOVERY_KERNEL_MODULES),$(TARGET_RECOVERY_ROOT_OUT),,$(call intermediates-dir-for,PACKAGING,depmod_recovery)))
- $(hide) rm -f $(TARGET_RECOVERY_ROOT_OUT)/init*.rc
+ # Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc.
+ $(hide) find $(TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f
$(hide) cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/
$(hide) cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/ || true # Ignore error when the src file doesn't exist.
$(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res
diff --git a/core/combo/javac.mk b/core/combo/javac.mk
index 625ac3f..cb034e9 100644
--- a/core/combo/javac.mk
+++ b/core/combo/javac.mk
@@ -17,6 +17,12 @@
endif
endif
+ifdef TARGET_BUILD_APPS
+ ifndef TURBINE_ENABLED
+ TURBINE_ENABLED := false
+ endif
+endif
+
ifeq ($(OVERRIDE_ANDROID_JAVA_HOME),)
ANDROID_JAVA_HOME := prebuilts/jdk/jdk8/$(HOST_PREBUILT_TAG)
else
diff --git a/core/definitions.mk b/core/definitions.mk
index 0f7c765..14e4509 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -671,34 +671,27 @@
## $(2): Non-empty if IS_HOST_MODULE
###########################################################
-# $(1): library name
-# $(2): Non-empty if IS_HOST_MODULE
-define _java-lib-dir
-$(call intermediates-dir-for, \
- JAVA_LIBRARIES,$(1),$(2),COMMON)
-endef
-
-# $(1): library name
-# $(2): Non-empty if IS_HOST_MODULE
-define _java-lib-full-classes.jar
-$(call _java-lib-dir,$(1),$(2))/classes.jar
-endef
-
# Get the jar files (you can pass to "javac -classpath") of static or shared
# Java libraries that you want to link against.
# $(1): library name list
# $(2): Non-empty if IS_HOST_MODULE
define java-lib-files
-$(foreach lib,$(1),$(call _java-lib-full-classes.jar,$(lib),$(2)))
+$(foreach lib,$(1),$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),$(2),COMMON)/classes.jar)
endef
# Get the header jar files (you can pass to "javac -classpath") of static or shared
# Java libraries that you want to link against.
# $(1): library name list
# $(2): Non-empty if IS_HOST_MODULE
+ifneq ($(TURBINE_ENABLED),false)
define java-lib-header-files
-$(foreach lib,$(1),$(call intermediates-dir-for, JAVA_LIBRARIES,$(lib),$(2),COMMON)/classes-header.jar)
+$(foreach lib,$(1),$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),$(2),COMMON)/classes-header.jar)
endef
+else
+define java-lib-header-files
+$(call java-lib-files,$(1),$(2))
+endef
+endif
# Get the dependency files (you can put on the right side of "|" of a build rule)
# of the Java libraries.
@@ -712,6 +705,25 @@
$(call java-lib-files,$(1),$(2))
endef
+# Get the jar files (you can pass to "javac -classpath") of static or shared
+# APK libraries that you want to link against.
+# $(1): library name list
+define app-lib-files
+$(foreach lib,$(1),$(call intermediates-dir-for,APPS,$(lib),,COMMON)/classes.jar)
+endef
+
+# Get the header jar files (you can pass to "javac -classpath") of static or shared
+# APK libraries that you want to link against.
+# $(1): library name list
+ifneq ($(TURBINE_ENABLED),false)
+define app-lib-header-files
+$(foreach lib,$(1),$(call intermediates-dir-for,APPS,$(lib),,COMMON)/classes-header.jar)
+endef
+else
+define app-lib-header-files
+$(call app-lib-files,$(1))
+endef
+endif
###########################################################
## Convert "core ext framework" to "out/.../classes.jack ..."
@@ -719,16 +731,10 @@
## $(2): Non-empty if IS_HOST_MODULE
###########################################################
-# $(1): library name
-# $(2): Non-empty if IS_HOST_MODULE
-define _jack-lib-full-classes
-$(call _java-lib-dir,$(1),$(2))/classes.jack
-endef
-
# $(1): library name list
# $(2): Non-empty if IS_HOST_MODULE
define jack-lib-files
-$(foreach lib,$(1),$(call _jack-lib-full-classes,$(lib),$(2)))
+$(foreach lib,$(1),$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),$(2),COMMON)/classes.jack)
endef
###########################################################
diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk
index da80509..7ae4a0a 100644
--- a/core/host_dalvik_java_library.mk
+++ b/core/host_dalvik_java_library.mk
@@ -119,6 +119,8 @@
| $(SOONG_JAVAC_WRAPPER)
$(transform-host-java-to-dalvik-package)
+ifneq ($(TURBINE_ENABLED),false)
+
$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): \
@@ -147,6 +149,8 @@
$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar)))
+endif # TURBINE_ENABLED != false
+
$(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_combined_jar): $(full_classes_compiled_jar) \
$(jar_manifest_file) \
diff --git a/core/host_java_library.mk b/core/host_java_library.mk
index 43a04cc..c9499ea 100644
--- a/core/host_java_library.mk
+++ b/core/host_java_library.mk
@@ -122,4 +122,6 @@
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(LOCAL_BUILT_MODULE)))
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_jar)))
+ifneq ($(TURBINE_DISABLED),false)
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_header_jar)))
+endif
diff --git a/core/java.mk b/core/java.mk
index d6c37e5..0382c47 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -499,6 +499,8 @@
| $(SOONG_JAVAC_WRAPPER)
$(transform-java-to-classes.jar)
+ifneq ($(TURBINE_ENABLED),false)
+
$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): \
@@ -527,6 +529,8 @@
$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar)))
+endif # TURBINE_ENABLED != false
+
javac-check : $(full_classes_compiled_jar)
javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar)
@@ -735,7 +739,9 @@
endif
endif
-$(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
+ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
+ $(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
+endif
$(full_classes_proguard_jar): PRIVATE_PROGUARD_INJAR_FILTERS := $(proguard_injar_filters)
$(full_classes_proguard_jar): PRIVATE_EXTRA_INPUT_JAR := $(extra_input_jar)
$(full_classes_proguard_jar): PRIVATE_PROGUARD_FLAGS := $(legacy_proguard_flags) $(common_proguard_flags) $(LOCAL_PROGUARD_FLAGS)
diff --git a/core/java_common.mk b/core/java_common.mk
index 5375e5a..a416795 100644
--- a/core/java_common.mk
+++ b/core/java_common.mk
@@ -174,15 +174,8 @@
annotation_processor_jars :=
endif
-full_static_java_libs := \
- $(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
- $(call intermediates-dir-for, \
- JAVA_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE),COMMON)/classes.jar)
-
-full_static_java_header_libs := \
- $(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
- $(call intermediates-dir-for, \
- JAVA_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE),COMMON)/classes-header.jar)
+full_static_java_libs := $(call java-lib-files,$(LOCAL_STATIC_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
+full_static_java_header_libs := $(call java-lib-header-files,$(LOCAL_STATIC_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JAVA_LIBRARIES := $(full_static_java_libs)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JAVA_HEADER_LIBRARIES := $(full_static_java_header_libs)
@@ -283,14 +276,8 @@
# shared libraries, allowing them to make use of the code in the linked apk.
apk_libraries := $(sort $(LOCAL_APK_LIBRARIES) $(LOCAL_RES_LIBRARIES))
ifneq ($(apk_libraries),)
- link_apk_libraries := \
- $(foreach lib,$(apk_libraries), \
- $(call intermediates-dir-for, \
- APPS,$(lib),,COMMON)/classes-pre-proguard.jar)
- link_apk_header_libs := \
- $(foreach lib,$(apk_libraries), \
- $(call intermediates-dir-for, \
- APPS,$(lib),,COMMON)/classes-header.jar)
+ link_apk_libraries := $(call app-lib-files,$(apk_libraries))
+ link_apk_header_libs := $(call app-lib-header-files,$(apk_libraries))
# link against the jar with full original names (before proguard processing).
full_shared_java_libs += $(link_apk_libraries)
@@ -312,7 +299,11 @@
APPS,$(LOCAL_INSTRUMENTATION_FOR),,COMMON)
# link against the jar with full original names (before proguard processing).
link_instr_classes_jar := $(link_instr_intermediates_dir.COMMON)/classes-pre-proguard.jar
- link_instr_classes_header_jar := $(link_instr_intermediates_dir.COMMON)/classes-header.jar
+ ifneq ($(TURBINE_ENABLED),false)
+ link_instr_classes_header_jar := $(link_instr_intermediates_dir.COMMON)/classes-header.jar
+ else
+ link_instr_classes_header_jar := $(link_instr_intermediates_dir.COMMON)/classes.jar
+ endif
full_java_libs += $(link_instr_classes_jar)
full_java_header_libs += $(link_instr_classes_header_jar)
endif # LOCAL_INSTRUMENTATION_FOR
@@ -383,12 +374,14 @@
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JACK_LIBRARIES := $(full_static_jack_libs)
full_shared_jack_libs := $(call jack-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
-ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
- my_jack_bootclasspath := $(TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES)
- ifdef LOCAL_IS_HOST_MODULE
- my_jack_bootclasspath := $(addsuffix -hostdex,$(my_jack_bootclasspath))
+ifndef LOCAL_SDK_VERSION
+ ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
+ my_jack_bootclasspath := $(TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES)
+ ifdef LOCAL_IS_HOST_MODULE
+ my_jack_bootclasspath := $(addsuffix -hostdex,$(my_jack_bootclasspath))
+ endif
+ full_shared_jack_libs := $(call jack-lib-files,$(my_jack_bootclasspath),$(LOCAL_IS_HOST_MODULE)) $(full_shared_jack_libs)
endif
- full_shared_jack_libs := $(call jack-lib-files,$(my_jack_bootclasspath),$(LOCAL_IS_HOST_MODULE)) $(full_shared_jack_libs)
endif
full_jack_deps := $(full_shared_jack_libs)
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 24816e9..f1ea70e 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -468,8 +468,10 @@
$(common_classes_jar) : $(my_src_jar)
$(transform-prebuilt-to-target)
+ifneq ($(TURBINE_ENABLED),false)
$(common_header_jar) : $(my_src_jar)
$(transform-prebuilt-to-target)
+endif
else # !LOCAL_IS_HOST_MODULE
# for target java libraries, the LOCAL_BUILT_MODULE is in a product-specific dir,
@@ -520,8 +522,10 @@
$(common_classes_jar) : $(my_src_jar)
$(transform-prebuilt-to-target)
+ifneq ($(TURBINE_ENABLED),false)
$(common_header_jar) : $(my_src_jar)
$(transform-prebuilt-to-target)
+endif
$(common_classes_pre_proguard_jar) : $(my_src_jar)
$(transform-prebuilt-to-target)
diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk
index ce09eb1..9198d68 100644
--- a/core/soong_java_prebuilt.mk
+++ b/core/soong_java_prebuilt.mk
@@ -26,11 +26,13 @@
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_jar)))
+ifneq ($(TURBINE_DISABLED),false)
ifdef LOCAL_SOONG_HEADER_JAR
$(eval $(call copy-one-file,$(LOCAL_SOONG_HEADER_JAR),$(full_classes_header_jar)))
else
$(eval $(call copy-one-file,$(full_classes_jar),$(full_classes_header_jar)))
endif
+endif # TURBINE_DISABLED != false
ifdef LOCAL_SOONG_DEX_JAR
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
diff --git a/target/product/aosp_mips.mk b/target/product/aosp_mips.mk
index a76b93a..5ee6185 100644
--- a/target/product/aosp_mips.mk
+++ b/target/product/aosp_mips.mk
@@ -1,5 +1,5 @@
#
-# Copyright 2013 The Android Open-Source Project
+# Copyright 2017 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.
@@ -13,6 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+PRODUCT_PROPERTY_OVERRIDES += \
+ rild.libpath=/vendor/lib/libreference-ril.so
+
+# Note: the following lines need to stay at the beginning so that it can
+# take priority and override the rules it inherit from other mk files
+# see copy file rules in core/Makefile
+PRODUCT_COPY_FILES += \
+ development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \
+ prebuilts/qemu-kernel/mips/3.18/kernel-qemu2:kernel-ranchu \
+ device/generic/goldfish/fstab.ranchu.mips:root/fstab.ranchu \
+ device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early
+
include $(SRC_TARGET_DIR)/product/full_mips.mk
PRODUCT_NAME := aosp_mips
diff --git a/target/product/aosp_mips64.mk b/target/product/aosp_mips64.mk
index f606858..73d3731 100644
--- a/target/product/aosp_mips64.mk
+++ b/target/product/aosp_mips64.mk
@@ -1,5 +1,5 @@
#
-# Copyright 2013 The Android Open-Source Project
+# Copyright 2017 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.
@@ -14,14 +14,22 @@
# limitations under the License.
#
+PRODUCT_PROPERTY_OVERRIDES += \
+ rild.libpath=/vendor/lib64/libreference-ril.so
+
# This is a build configuration for a full-featured build of the
# Open-Source part of the tree. It's geared toward a US-centric
-# mips64 build quite specifically for the emulator, and might not be
+# build quite specifically for the emulator, and might not be
# entirely appropriate to inherit from for on-device configurations.
-# This is for enabling ethernet support for ranchu.
-# Consider removing this after RIL support is provided in ranchu.
-PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml
+# Note: the following lines need to stay at the beginning so that it can
+# take priority and override the rules it inherit from other mk files
+# see copy file rules in core/Makefile
+PRODUCT_COPY_FILES += \
+ development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \
+ prebuilts/qemu-kernel/mips64/3.18/kernel-qemu2:kernel-ranchu \
+ device/generic/goldfish/fstab.ranchu.mips:root/fstab.ranchu \
+ device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)