From 204dd14a2ca2483fd6da4d98dfc7a2910564c076 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 9 Aug 2017 16:24:02 -0700 Subject: [PATCH] Use java variables from soong Use TARGET_JAVAC and HOST_JAVAC exported from soong. Test: m -j checkbuild Change-Id: Ic094174149ea304c0b06ddc023417acf3602d5a3 --- core/combo/javac.mk | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/core/combo/javac.mk b/core/combo/javac.mk index 0538c5299d..835ee82709 100644 --- a/core/combo/javac.mk +++ b/core/combo/javac.mk @@ -1,12 +1,11 @@ # Selects a Java compiler. # # Inputs: -# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system -# default -# ALTERNATE_JAVAC -- the alternate java compiler to use +# OVERRIDE_ANDROID_JAVA_HOME -- alternate location to use for jdk # # Outputs: -# COMMON_JAVAC -- Java compiler command with common arguments +# ANDROID_JAVA_HOME -- Directory that contains JDK +# ANDROID_JAVA_TOOLCHAIN -- Directory that contains javac and other java tools # ifndef ANDROID_COMPILE_WITH_JACK @@ -23,8 +22,6 @@ ifndef ANDROID_COMPILE_WITH_JACK endif endif -common_jdk_flags := -Xmaxerrs 9999999 - ifeq ($(OVERRIDE_ANDROID_JAVA_HOME),) ANDROID_JAVA_HOME := prebuilts/jdk/jdk8/$(HOST_PREBUILT_TAG) else @@ -34,30 +31,6 @@ endif ANDROID_JAVA_TOOLCHAIN := $(ANDROID_JAVA_HOME)/bin export JAVA_HOME := $(abspath $(ANDROID_JAVA_HOME)) -# Use the indexer wrapper to index the codebase instead of the javac compiler -ifeq ($(ALTERNATE_JAVAC),) -JAVACC := $(ANDROID_JAVA_TOOLCHAIN)/javac -else -JAVACC := $(ALTERNATE_JAVAC) -endif - +# TODO(ccross): remove this, it is needed for now because it is used by +# config.mk before makevars from soong are loaded JAVA := $(ANDROID_JAVA_TOOLCHAIN)/java -JAVADOC := $(ANDROID_JAVA_TOOLCHAIN)/javadoc -JAR := $(ANDROID_JAVA_TOOLCHAIN)/jar - -# The actual compiler can be wrapped by setting the JAVAC_WRAPPER var. -ifdef JAVAC_WRAPPER - ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC))) - JAVACC := $(JAVAC_WRAPPER) $(JAVACC) - endif -endif - -COMMON_JAVAC := $(JAVACC) -J-Xmx2048M $(common_jdk_flags) - -GLOBAL_JAVAC_DEBUG_FLAGS := -g - -HOST_JAVAC ?= $(COMMON_JAVAC) -TARGET_JAVAC ?= $(COMMON_JAVAC) - -#$(info HOST_JAVAC=$(HOST_JAVAC)) -#$(info TARGET_JAVAC=$(TARGET_JAVAC))