From d097a9b4b6edc1bc502e9448eae1c910a8127d67 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Thu, 22 Sep 2016 17:07:15 +0100 Subject: [PATCH] Include core_lambda_stubs in core_oj. core-oj already contains most of java.lang.invoke - there isn't much point in complicating build rules for bundled targets by continuing to rely on stubs. The stubs target continues to exist for compiling code that contains Java 8 language features against the M sdk. bug: 31675876 Test: make checkbuild Change-Id: I9a5ed695fd2406919a218a7dc1c4a7560cc39b91 --- JavaLibrary.mk | 12 ++++++------ openjdk_java_files.mk | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/JavaLibrary.mk b/JavaLibrary.mk index 470484edd..ef7703ef9 100644 --- a/JavaLibrary.mk +++ b/JavaLibrary.mk @@ -188,7 +188,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(test_src_files) LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp core-junit junit4-target bouncycastle mockito-target +LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp core-junit junit4-target bouncycastle mockito-target LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support sqlite-jdbc mockwebserver nist-pkix-tests LOCAL_JAVACFLAGS := $(local_javac_flags) LOCAL_JAVA_LANGUAGE_VERSION := 1.8 @@ -217,7 +217,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-test-java-files-under, jsr166-tests) LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs core-junit junit4-target +LOCAL_JAVA_LIBRARIES := core-oj core-libart core-junit junit4-target LOCAL_JAVACFLAGS := $(local_javac_flags) LOCAL_MODULE := jsr166-tests LOCAL_JAVA_LANGUAGE_VERSION := 1.8 @@ -229,7 +229,7 @@ endif ifeq ($(LIBCORE_SKIP_TESTS),) include $(CLEAR_VARS) LOCAL_NO_STANDARD_LIBRARIES := true - LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle + LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle LOCAL_STATIC_JAVA_LIBRARIES := testng LOCAL_JAVACFLAGS := $(local_javac_flags) LOCAL_MODULE_TAGS := optional @@ -249,7 +249,7 @@ ifeq ($(LIBCORE_SKIP_TESTS),) # Include source code as part of JAR LOCAL_JAVA_RESOURCE_DIRS := ojluni/src/test/dist LOCAL_NO_STANDARD_LIBRARIES := true - LOCAL_JAVA_LIBRARIES := core-oj core-libart core-lambda-stubs okhttp bouncycastle testng + LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp bouncycastle testng LOCAL_JAVACFLAGS := $(local_javac_flags) LOCAL_MODULE_TAGS := optional LOCAL_JAVA_LANGUAGE_VERSION := 1.8 @@ -335,7 +335,7 @@ ifeq ($(LIBCORE_SKIP_TESTS),) LOCAL_SRC_FILES := $(test_src_files) LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) LOCAL_NO_STANDARD_LIBRARIES := true - LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex core-junit-hostdex junit4-target-hostdex core-tests-support-hostdex mockito-api-hostdex + LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex okhttp-hostdex bouncycastle-hostdex core-junit-hostdex junit4-target-hostdex core-tests-support-hostdex mockito-api-hostdex LOCAL_STATIC_JAVA_LIBRARIES := sqlite-jdbc-host mockwebserver-host nist-pkix-tests-host LOCAL_JAVACFLAGS := $(local_javac_flags) LOCAL_MODULE_TAGS := optional @@ -365,7 +365,7 @@ ifeq ($(LIBCORE_SKIP_TESTS),) include $(CLEAR_VARS) LOCAL_SRC_FILES := $(ojtest_src_files) LOCAL_NO_STANDARD_LIBRARIES := true - LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex core-lambda-stubs-hostdex okhttp-hostdex bouncycastle-hostdex + LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex okhttp-hostdex bouncycastle-hostdex LOCAL_STATIC_JAVA_LIBRARIES := testng-hostdex LOCAL_JAVACFLAGS := $(local_javac_flags) LOCAL_MODULE_TAGS := optional diff --git a/openjdk_java_files.mk b/openjdk_java_files.mk index e717cae74..a8fc634fb 100644 --- a/openjdk_java_files.mk +++ b/openjdk_java_files.mk @@ -1615,16 +1615,18 @@ openjdk_java_files := \ ojluni/src/main/java/sun/util/logging/PlatformLogger.java \ ojluni/src/main/java/sun/util/ResourceBundleEnumeration.java \ ojluni/src/main/java/sun/util/resources/OpenListResourceBundle.java \ - $(openjdk_javadoc_files) + $(openjdk_javadoc_files) \ + $(openjdk_lambda_stub_files) # Stubs needed to satisfy javac's dependencies when compiling lambda code. These are # not used on Android devices or required by the Jack compiler. # -# The stub files in openjdk_lambda_duplicate_stub_files are present in core-oj as -# well, and need to be included here to support compiling against older SDKs and the -# like. This additional bit of ugliness if required to avoid a circular dependency -# between core-all and these stubs. Eventually, all of these stubs will become -# "duplicates" and then that list can be renamed to "openjdk_lambda_stub_files". +# On aosp/master: +# openjdk_lambda_stub_files : These are included in core-oj as stubs +# openjdk_lambda_duplicate_stub_files : These contain complete implementations in core-oj. +# +# On older platforms : Both sets of stub files are used and core-oj does not contain +# any of these classes. openjdk_lambda_stub_files := \ ojluni/src/lambda/java/java/lang/invoke/CallSite.java \ ojluni/src/lambda/java/java/lang/invoke/LambdaMetafactory.java \