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

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

Merge "Disable java when JAVA_NOT_REQUIRED is set"

parents a465cf68 fdf89cd5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -844,4 +844,12 @@ endif
RSCOMPAT_32BIT_ONLY_API_LEVELS := 8 9 10 11 12 13 14 15 16 17 18 19 20
RSCOMPAT_NO_USAGEIO_API_LEVELS := 8 9 10 11 12 13

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)
endif

include $(BUILD_SYSTEM)/dumpvar.mk
+5 −5
Original line number Diff line number Diff line
@@ -57,9 +57,6 @@ TOPDIR :=

BUILD_SYSTEM := $(TOPDIR)build/core

# Ensure JAVA_NOT_REQUIRED is not set externally.
JAVA_NOT_REQUIRED := false

# This is the default target.  It must be the first declared target.
.PHONY: droid
DEFAULT_GOAL := droid
@@ -148,8 +145,9 @@ include $(BUILD_SYSTEM)/cleanbuild.mk
-include vendor/google/build/config.mk

VERSION_CHECK_SEQUENCE_NUMBER := 6
JAVA_NOT_REQUIRED_CHECKED :=
-include $(OUT_DIR)/versions_checked.mk
ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED))
ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER)$(JAVA_NOT_REQUIRED),$(VERSIONS_CHECKED)$(JAVA_NOT_REQUIRED_CHECKED))

$(info Checking build tools versions...)

@@ -180,7 +178,7 @@ $(warning ************************************************************)
$(error Directory names containing spaces not supported)
endif

ifeq ($(JAVA_NOT_REQUIRED), false)
ifneq ($(JAVA_NOT_REQUIRED),true)
java_version_str := $(shell unset _JAVA_OPTIONS && java -version 2>&1)
javac_version_str := $(shell unset _JAVA_OPTIONS && javac -version 2>&1)

@@ -271,6 +269,8 @@ $(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \
        > $(OUT_DIR)/versions_checked.mk)
$(shell echo 'BUILD_EMULATOR ?= $(BUILD_EMULATOR)' \
        >> $(OUT_DIR)/versions_checked.mk)
$(shell echo 'JAVA_NOT_REQUIRED_CHECKED := $(JAVA_NOT_REQUIRED)' \
        >> $(OUT_DIR)/versions_checked.mk)
endif

# These are the modifier targets that don't do anything themselves, but

core/no_java_path/jar

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

core/no_java_path/java

0 → 100755
+4 −0
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