Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3d94873 authored by Dan Willemsen's avatar Dan Willemsen Committed by Gerrit Code Review
Browse files

Merge changes from topic "soong_ui_java"

* changes:
  Remove Java PATH check, deprecate using PATH in Kati
  Remove JAVA_NOT_REQUIRED
parents 8639879e 2ec3e4a2
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
# 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
#

@@ -16,19 +12,7 @@ ifdef TARGET_BUILD_APPS
  endif
endif

ifneq ($(OVERRIDE_ANDROID_JAVA_HOME),)
  # Use this build toolchain instead of the bundled one.
  ANDROID_JAVA_HOME := $(OVERRIDE_ANDROID_JAVA_HOME)
else # !OVERRIDE_ANDROID_JAVA_HOME
  ifneq ($(EXPERIMENTAL_USE_OPENJDK9),)
    ANDROID_JAVA_HOME := prebuilts/jdk/jdk9/$(HOST_PREBUILT_TAG)
  else
    ANDROID_JAVA_HOME := prebuilts/jdk/jdk8/$(HOST_PREBUILT_TAG)
  endif
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
+3 −19
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ backslash := $(patsubst %a,%,$(backslash))
# If a rule fails, delete $@.
.DELETE_ON_ERROR:

# Mark variables deprecated/obsolete
$(KATI_deprecated_var PATH,Do not use PATH directly)

# Used to force goals to build.  Only use for conditionally defined goals.
.PHONY: FORCE
FORCE:
@@ -860,25 +863,6 @@ else
APPS_DEFAULT_VERSION_NAME := $(PLATFORM_VERSION)
endif

ifeq ($(JAVA_NOT_REQUIRED),true)
# Remove java and tools from our path so that we make sure nobody uses them.
unexport ANDROID_JAVA_HOME
unexport JAVA_HOME
export ANDROID_BUILD_PATHS:=$(abspath $(BUILD_SYSTEM)/no_java_path):$(ANDROID_BUILD_PATHS)
export PATH:=$(abspath $(BUILD_SYSTEM)/no_java_path):$(PATH)
else
  # Put java first on the path
  # TODO(ccross): remove this once tools run during the build no longer depend on
  # finding java in the path
  ifeq (,$(strip $(CALLED_FROM_SETUP)))
    ifneq ($(shell which java),$(abspath $(ANDROID_JAVA_TOOLCHAIN)/java))
      $(warning Found incorrect java $(shell which java) in $$PATH)
      $(warning Adding $(abspath $(ANDROID_JAVA_TOOLCHAIN)) to $$PATH)
      export PATH:=$(abspath $(ANDROID_JAVA_TOOLCHAIN)):$(PATH)
    endif
  endif
endif

# Projects clean of compiler warnings should be compiled with -Werror.
# If most modules in a directory such as external/ have warnings,
# the directory should be in ANDROID_WARNING_ALLOWED_PROJECTS list.

core/no_java_path/jar

deleted120000 → 0
+0 −1
Original line number Diff line number Diff line
java
 No newline at end of file

core/no_java_path/jarsigner

deleted120000 → 0
+0 −1
Original line number Diff line number Diff line
java
 No newline at end of file

core/no_java_path/java

deleted100755 → 0
+0 −4
Original line number Diff line number Diff line
#!/bin/bash

echo "Error: JAVA_NOT_REQUIRED=true, $(basename $0) is unavailable." 1>&2
exit 1
Loading