Allow java targets to support 1.8 source / target
This change enables build rules to specify: LOCAL_JAVA_LANGUAGE_VERSION := 1.8 to enable -source 1.8 -target 1.8 for javac and equivalent flags for Jack. Bug: 26753820 Change-Id: I7991fafe4978485354663f091f4d78a0cc73ba26
This commit is contained in:
@@ -342,6 +342,7 @@ LOCAL_CLANG_32:=
|
|||||||
LOCAL_CLANG_64:=
|
LOCAL_CLANG_64:=
|
||||||
LOCAL_INIT_RC_32:=
|
LOCAL_INIT_RC_32:=
|
||||||
LOCAL_INIT_RC_64:=
|
LOCAL_INIT_RC_64:=
|
||||||
|
LOCAL_JAVA_LANGUAGE_VERSION:=
|
||||||
|
|
||||||
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
|
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
|
||||||
# iterate over thousands of entries every time.
|
# iterate over thousands of entries every time.
|
||||||
|
@@ -14,7 +14,7 @@ ifndef ANDROID_COMPILE_WITH_JACK
|
|||||||
ANDROID_COMPILE_WITH_JACK := true
|
ANDROID_COMPILE_WITH_JACK := true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
common_jdk_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
|
common_jdk_flags := -Xmaxerrs 9999999
|
||||||
|
|
||||||
# Use the indexer wrapper to index the codebase instead of the javac compiler
|
# Use the indexer wrapper to index the codebase instead of the javac compiler
|
||||||
ifeq ($(ALTERNATE_JAVAC),)
|
ifeq ($(ALTERNATE_JAVAC),)
|
||||||
|
@@ -1,5 +1,13 @@
|
|||||||
# Common to host and target Java modules.
|
# Common to host and target Java modules.
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
## Java version
|
||||||
|
###########################################################
|
||||||
|
ifeq (,$(LOCAL_JAVA_LANGUAGE_VERSION))
|
||||||
|
LOCAL_JAVA_LANGUAGE_VERSION := 1.7
|
||||||
|
endif
|
||||||
|
LOCAL_JAVACFLAGS += -source $(LOCAL_JAVA_LANGUAGE_VERSION) -target $(LOCAL_JAVA_LANGUAGE_VERSION)
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
## .proto files: Compile proto files to .java
|
## .proto files: Compile proto files to .java
|
||||||
###########################################################
|
###########################################################
|
||||||
@@ -267,6 +275,8 @@ ALL_MODULES.$(my_register_name).INTERMEDIATE_SOURCE_DIR := \
|
|||||||
ifdef LOCAL_JACK_ENABLED
|
ifdef LOCAL_JACK_ENABLED
|
||||||
ifdef need_compile_java
|
ifdef need_compile_java
|
||||||
|
|
||||||
|
LOCAL_JACK_FLAGS += -D jack.java.source.version=$(LOCAL_JAVA_LANGUAGE_VERSION)
|
||||||
|
|
||||||
full_static_jack_libs := \
|
full_static_jack_libs := \
|
||||||
$(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
|
$(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
|
||||||
$(call intermediates-dir-for, \
|
$(call intermediates-dir-for, \
|
||||||
|
Reference in New Issue
Block a user