Merge "Use system modules generated by soong when using javac -target 1.9"
am: 58cd98dc47
Change-Id: I1525b7088afee77baee014fd346cf19cf6a9641e
This commit is contained in:
commit
7c381d8015
6 changed files with 57 additions and 15 deletions
|
@ -835,6 +835,9 @@ TARGET_AVAILABLE_SDK_VERSIONS := $(call numerically_sort,\
|
||||||
# We don't have prebuilt test_current SDK yet.
|
# We don't have prebuilt test_current SDK yet.
|
||||||
TARGET_AVAILABLE_SDK_VERSIONS := test_current $(TARGET_AVAILABLE_SDK_VERSIONS)
|
TARGET_AVAILABLE_SDK_VERSIONS := test_current $(TARGET_AVAILABLE_SDK_VERSIONS)
|
||||||
|
|
||||||
|
TARGET_SDK_VERSIONS_WITHOUT_JAVA_18_SUPPORT := $(call numbers_less_than,24,$(TARGET_AVAILABLE_SDK_VERSIONS))
|
||||||
|
TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT := $(call numbers_less_than,27,$(TARGET_AVAILABLE_SDK_VERSIONS))
|
||||||
|
|
||||||
INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.txt
|
INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.txt
|
||||||
INTERNAL_PLATFORM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/removed.txt
|
INTERNAL_PLATFORM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/removed.txt
|
||||||
INTERNAL_PLATFORM_SYSTEM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-api.txt
|
INTERNAL_PLATFORM_SYSTEM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-api.txt
|
||||||
|
|
|
@ -2251,9 +2251,11 @@ $(hide) mkdir -p $(PRIVATE_CLASS_INTERMEDIATES_DIR) $(PRIVATE_ANNO_INTERMEDIATES
|
||||||
$(hide) if [ -s $(PRIVATE_JAVA_SOURCE_LIST) ] ; then \
|
$(hide) if [ -s $(PRIVATE_JAVA_SOURCE_LIST) ] ; then \
|
||||||
$(SOONG_JAVAC_WRAPPER) $(JAVAC_WRAPPER) $(1) -encoding UTF-8 \
|
$(SOONG_JAVAC_WRAPPER) $(JAVAC_WRAPPER) $(1) -encoding UTF-8 \
|
||||||
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \
|
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \
|
||||||
|
$(if $(PRIVATE_USE_SYSTEM_MODULES), \
|
||||||
|
$(addprefix --system=,$(PRIVATE_SYSTEM_MODULES)), \
|
||||||
$(addprefix -bootclasspath ,$(strip \
|
$(addprefix -bootclasspath ,$(strip \
|
||||||
$(call normalize-path-list,$(PRIVATE_BOOTCLASSPATH)) \
|
$(call normalize-path-list,$(PRIVATE_BOOTCLASSPATH)) \
|
||||||
$(PRIVATE_EMPTY_BOOTCLASSPATH))) \
|
$(PRIVATE_EMPTY_BOOTCLASSPATH)))) \
|
||||||
$(addprefix -classpath ,$(strip \
|
$(addprefix -classpath ,$(strip \
|
||||||
$(call normalize-path-list,$(2)))) \
|
$(call normalize-path-list,$(2)))) \
|
||||||
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \
|
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \
|
||||||
|
@ -2300,6 +2302,7 @@ $(1): \
|
||||||
$(3) \
|
$(3) \
|
||||||
$(5) \
|
$(5) \
|
||||||
$$(full_java_bootclasspath_libs) \
|
$$(full_java_bootclasspath_libs) \
|
||||||
|
$$(full_java_system_modules_deps) \
|
||||||
$$(layers_file) \
|
$$(layers_file) \
|
||||||
$$(annotation_processor_deps) \
|
$$(annotation_processor_deps) \
|
||||||
$$(NORMALIZE_PATH) \
|
$$(NORMALIZE_PATH) \
|
||||||
|
|
|
@ -93,6 +93,7 @@ $(full_classes_compiled_jar): \
|
||||||
$(java_sources_deps) \
|
$(java_sources_deps) \
|
||||||
$(full_java_header_libs) \
|
$(full_java_header_libs) \
|
||||||
$(full_java_bootclasspath_libs) \
|
$(full_java_bootclasspath_libs) \
|
||||||
|
$(full_java_system_modules_deps) \
|
||||||
$(annotation_processor_deps) \
|
$(annotation_processor_deps) \
|
||||||
$(NORMALIZE_PATH) \
|
$(NORMALIZE_PATH) \
|
||||||
$(JAR_ARGS) \
|
$(JAR_ARGS) \
|
||||||
|
|
|
@ -499,6 +499,7 @@ $(full_classes_turbine_jar): \
|
||||||
$(java_sources_deps) \
|
$(java_sources_deps) \
|
||||||
$(full_java_header_libs) \
|
$(full_java_header_libs) \
|
||||||
$(full_java_bootclasspath_libs) \
|
$(full_java_bootclasspath_libs) \
|
||||||
|
$(full_java_system_modules_deps) \
|
||||||
$(NORMALIZE_PATH) \
|
$(NORMALIZE_PATH) \
|
||||||
$(JAR_ARGS) \
|
$(JAR_ARGS) \
|
||||||
$(ZIPTIME) \
|
$(ZIPTIME) \
|
||||||
|
|
|
@ -15,20 +15,17 @@
|
||||||
# Modules can override this logic by specifying
|
# Modules can override this logic by specifying
|
||||||
# LOCAL_JAVA_LANGUAGE_VERSION explicitly.
|
# LOCAL_JAVA_LANGUAGE_VERSION explicitly.
|
||||||
ifeq (,$(LOCAL_JAVA_LANGUAGE_VERSION))
|
ifeq (,$(LOCAL_JAVA_LANGUAGE_VERSION))
|
||||||
private_sdk_versions_without_any_java_18_support := 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
ifneq (,$(filter $(LOCAL_SDK_VERSION), $(TARGET_SDK_VERSIONS_WITHOUT_JAVA_18_SUPPORT)))
|
||||||
ifneq (,$(filter $(LOCAL_SDK_VERSION), $(private_sdk_versions_without_any_java_18_support)))
|
|
||||||
LOCAL_JAVA_LANGUAGE_VERSION := 1.7
|
LOCAL_JAVA_LANGUAGE_VERSION := 1.7
|
||||||
else
|
else ifneq (,$(filter $(LOCAL_SDK_VERSION), $(TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT)))
|
||||||
ifneq ($(EXPERIMENTAL_USE_OPENJDK9),true)
|
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
|
||||||
|
else ifneq (,$(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS))
|
||||||
|
# TODO(ccross): allow 1.9 for current and unbundled once we have SDK system modules
|
||||||
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
|
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
|
||||||
else
|
else
|
||||||
private_sdk_versions_without_any_java_19_support := 24 25 26
|
# DEFAULT_JAVA_LANGUAGE_VERSION is 1.8 unless EXPERIMENTAL_USE_OPENJDK9=true
|
||||||
ifneq (,$(filter $(LOCAL_SDK_VERSION), $(private_sdk_versions_without_any_java_19_support)))
|
# in which case it is 1.9
|
||||||
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
|
LOCAL_JAVA_LANGUAGE_VERSION := $(DEFAULT_JAVA_LANGUAGE_VERSION)
|
||||||
else
|
|
||||||
LOCAL_JAVA_LANGUAGE_VERSION := 1.9
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
LOCAL_JAVACFLAGS += -source $(LOCAL_JAVA_LANGUAGE_VERSION) -target $(LOCAL_JAVA_LANGUAGE_VERSION)
|
LOCAL_JAVACFLAGS += -source $(LOCAL_JAVA_LANGUAGE_VERSION) -target $(LOCAL_JAVA_LANGUAGE_VERSION)
|
||||||
|
@ -201,6 +198,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RMTYPEDEFS := $(LOCAL_RMTYPEDEFS)
|
||||||
|
|
||||||
full_java_bootclasspath_libs :=
|
full_java_bootclasspath_libs :=
|
||||||
empty_bootclasspath :=
|
empty_bootclasspath :=
|
||||||
|
my_system_modules :=
|
||||||
|
|
||||||
# full_java_libs: The list of files that should be used as the classpath.
|
# full_java_libs: The list of files that should be used as the classpath.
|
||||||
# Using this list as a dependency list WILL NOT WORK.
|
# Using this list as a dependency list WILL NOT WORK.
|
||||||
|
@ -209,8 +207,13 @@ ifndef LOCAL_IS_HOST_MODULE
|
||||||
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
||||||
# No bootclasspath. But we still need "" to prevent javac from using default host bootclasspath.
|
# No bootclasspath. But we still need "" to prevent javac from using default host bootclasspath.
|
||||||
empty_bootclasspath := ""
|
empty_bootclasspath := ""
|
||||||
|
# Most users of LOCAL_NO_STANDARD_LIBRARIES really mean no framework libs,
|
||||||
|
# and manually add back the core libs. The ones that don't are in soong
|
||||||
|
# now, so just always assume that they want the default system modules
|
||||||
|
my_system_modules := $(DEFAULT_SYSTEM_MODULES)
|
||||||
else # LOCAL_NO_STANDARD_LIBRARIES
|
else # LOCAL_NO_STANDARD_LIBRARIES
|
||||||
full_java_bootclasspath_libs := $(call java-lib-header-files,$(TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES))
|
full_java_bootclasspath_libs := $(call java-lib-header-files,$(TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES))
|
||||||
|
my_system_modules := $(DEFAULT_SYSTEM_MODULES)
|
||||||
endif # LOCAL_NO_STANDARD_LIBRARIES
|
endif # LOCAL_NO_STANDARD_LIBRARIES
|
||||||
else
|
else
|
||||||
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
||||||
|
@ -255,6 +258,7 @@ else # LOCAL_IS_HOST_MODULE
|
||||||
full_java_bootclasspath_libs := $(call java-lib-header-files,$(addsuffix -hostdex,$(TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES)),true)
|
full_java_bootclasspath_libs := $(call java-lib-header-files,$(addsuffix -hostdex,$(TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES)),true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
my_system_modules := $(DEFAULT_SYSTEM_MODULES)
|
||||||
full_shared_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),true)
|
full_shared_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),true)
|
||||||
full_shared_java_header_libs := $(call java-lib-header-files,$(LOCAL_JAVA_LIBRARIES),true)
|
full_shared_java_header_libs := $(call java-lib-header-files,$(LOCAL_JAVA_LIBRARIES),true)
|
||||||
else # !USE_CORE_LIB_BOOTCLASSPATH
|
else # !USE_CORE_LIB_BOOTCLASSPATH
|
||||||
|
@ -270,8 +274,25 @@ ifdef empty_bootclasspath
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
full_java_system_modules_deps :=
|
||||||
|
my_system_modules_dir :=
|
||||||
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_USE_SYSTEM_MODULES :=
|
||||||
|
ifeq ($(LOCAL_JAVA_LANGUAGE_VERSION),1.9)
|
||||||
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_USE_SYSTEM_MODULES := true
|
||||||
|
ifdef my_system_modules
|
||||||
|
ifneq ($(my_system_modules),none)
|
||||||
|
ifndef SOONG_SYSTEM_MODULES_$(my_system_modules)
|
||||||
|
$(call pretty-error, Invalid system modules $(my_system_modules))
|
||||||
|
endif
|
||||||
|
full_java_system_modules_deps := $(SOONG_SYSTEM_MODULES_$(my_system_modules))
|
||||||
|
my_system_modules_dir := $(patsubst %/lib/modules,%,$(SOONG_SYSTEM_MODULES_$(my_system_modules)))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := $(full_java_bootclasspath_libs)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := $(full_java_bootclasspath_libs)
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EMPTY_BOOTCLASSPATH := $(empty_bootclasspath)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EMPTY_BOOTCLASSPATH := $(empty_bootclasspath)
|
||||||
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_SYSTEM_MODULES := $(my_system_modules_dir)
|
||||||
|
|
||||||
full_java_libs := $(full_shared_java_libs) $(full_static_java_libs) $(LOCAL_CLASSPATH)
|
full_java_libs := $(full_shared_java_libs) $(full_static_java_libs) $(LOCAL_CLASSPATH)
|
||||||
full_java_header_libs := $(full_shared_java_header_libs) $(full_static_java_header_libs)
|
full_java_header_libs := $(full_shared_java_header_libs) $(full_static_java_header_libs)
|
||||||
|
|
13
core/math.mk
13
core/math.mk
|
@ -72,6 +72,10 @@ define math_gt_or_eq
|
||||||
$(if $(filter $(1),$(call math_max,$(1),$(2))),true)
|
$(if $(filter $(1),$(call math_max,$(1),$(2))),true)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define math_lt
|
||||||
|
$(if $(call math_gt_or_eq,$(1),$(2)),,true)
|
||||||
|
endef
|
||||||
|
|
||||||
#$(warning $(call math_gt_or_eq, 2, 1))
|
#$(warning $(call math_gt_or_eq, 2, 1))
|
||||||
#$(warning $(call math_gt_or_eq, 1, 1))
|
#$(warning $(call math_gt_or_eq, 1, 1))
|
||||||
#$(warning $(if $(call math_gt_or_eq, 1, 2),false,true))
|
#$(warning $(if $(call math_gt_or_eq, 1, 2),false,true))
|
||||||
|
@ -81,6 +85,15 @@ define inc_and_print
|
||||||
$(strip $(eval $(1) := $($(1)) .)$(words $($(1))))
|
$(strip $(eval $(1) := $($(1)) .)$(words $($(1))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Returns the words in $2 that are numbers and are less than $1
|
||||||
|
define numbers_less_than
|
||||||
|
$(strip \
|
||||||
|
$(foreach n,$2, \
|
||||||
|
$(if $(call math_is_number,$(n)), \
|
||||||
|
$(if $(call math_lt,$(n),$(1)), \
|
||||||
|
$(n)))))
|
||||||
|
endef
|
||||||
|
|
||||||
_INT_LIMIT_WORDS := $(foreach a,x x,$(foreach b,x x x x x x x x x x x x x x x x,\
|
_INT_LIMIT_WORDS := $(foreach a,x x,$(foreach b,x x x x x x x x x x x x x x x x,\
|
||||||
$(foreach c,x x x x x x x x x x x x x x x x,x x x x x x x x x x x x x x x x)))
|
$(foreach c,x x x x x x x x x x x x x x x x,x x x x x x x x x x x x x x x x)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue