platform_build/core/combo/javac.mk
Colin Cross 2c69277218 Use java variables from soong
Use TARGET_JAVAC and HOST_JAVAC exported from soong.

Test: m -j checkbuild
Merged-In: Ic094174149ea304c0b06ddc023417acf3602d5a3
Change-Id: Ic094174149ea304c0b06ddc023417acf3602d5a3
(cherry picked from commit 204dd14a2c)
2017-08-29 13:02:07 -07:00

36 lines
1.2 KiB
Makefile

# Selects a Java compiler.
#
# Inputs:
# OVERRIDE_ANDROID_JAVA_HOME -- alternate location to use for jdk
#
# Outputs:
# ANDROID_JAVA_HOME -- Directory that contains JDK
# ANDROID_JAVA_TOOLCHAIN -- Directory that contains javac and other java tools
#
ifndef ANDROID_COMPILE_WITH_JACK
# TODO(b/64113890, b/35788202): remove PRODUCT_COMPILE_WITH_JACK
ifdef PRODUCT_COMPILE_WITH_JACK
ANDROID_COMPILE_WITH_JACK := $(PRODUCT_COMPILE_WITH_JACK)
else
# TODO(b/62038127): remove TARGET_BUILD_APPS check
ifdef TARGET_BUILD_APPS
ANDROID_COMPILE_WITH_JACK := true
else
ANDROID_COMPILE_WITH_JACK := false
endif
endif
endif
ifeq ($(OVERRIDE_ANDROID_JAVA_HOME),)
ANDROID_JAVA_HOME := prebuilts/jdk/jdk8/$(HOST_PREBUILT_TAG)
else
# Use this build toolchain instead of the bundled one.
ANDROID_JAVA_HOME := $(OVERRIDE_ANDROID_JAVA_HOME)
endif
ANDROID_JAVA_TOOLCHAIN := $(ANDROID_JAVA_HOME)/bin
export JAVA_HOME := $(abspath $(ANDROID_JAVA_HOME))
# 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