Remove code related to unused LOCAL_* variables
LOCAL_JETIFIER_ENABLED, LOCAL_NO_PIC, LOCAL_PREBUILT_STRIP_COMMENTS,
LOCAL_RMTYPEDEFS, and *.vts sources are never used. Remove them
and the code related to them.
Test: no change to out/build-aosp_cf_x86_64_phone.ninja
Change-Id: I2ca9e674602057cc163b8bc28b0c57a0b7cc4361
diff --git a/core/binary.mk b/core/binary.mk
index 6d73f9e..4c68ba7 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -354,17 +354,15 @@
# MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
# all code is position independent, and then those warnings get promoted to
# errors.
-ifneq ($(LOCAL_NO_PIC),true)
- ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
- my_cflags += -fPIE
- ifndef BUILD_HOST_static
- ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
- my_ldflags += -pie
- endif
+ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
+ my_cflags += -fPIE
+ ifndef BUILD_HOST_static
+ ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
+ my_ldflags += -pie
endif
- else
- my_cflags += -fPIC
endif
+else
+ my_cflags += -fPIC
endif
ifdef LOCAL_IS_HOST_MODULE
diff --git a/core/cc_prebuilt_internal.mk b/core/cc_prebuilt_internal.mk
index 2de4115..000159a 100644
--- a/core/cc_prebuilt_internal.mk
+++ b/core/cc_prebuilt_internal.mk
@@ -56,9 +56,6 @@
ifeq ($(filter SHARED_LIBRARIES EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
$(call pretty-error,Can strip/pack only shared libraries or executables)
endif
- ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
- $(call pretty-error,Cannot strip/pack scripts)
- endif
# Set the arch-specific variables to set up the strip rules
LOCAL_STRIP_MODULE_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := $(my_strip_module)
include $(BUILD_SYSTEM)/dynamic_binary.mk
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 0a5cb43..b73e9b4 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -133,7 +133,6 @@
LOCAL_JAVA_LIBRARIES:=
LOCAL_JAVA_RESOURCE_DIRS:=
LOCAL_JAVA_RESOURCE_FILES:=
-LOCAL_JETIFIER_ENABLED:=
LOCAL_JNI_SHARED_LIBRARIES:=
LOCAL_JNI_SHARED_LIBRARIES_ABI:=
LOCAL_CERTIFICATE_LINEAGE:=
@@ -177,7 +176,6 @@
LOCAL_NO_DEFAULT_COMPILER_FLAGS:=
LOCAL_NO_LIBCRT_BUILTINS:=
LOCAL_NO_NOTICE_FILE:=
-LOCAL_NO_PIC:=
LOCAL_NOSANITIZE:=
LOCAL_NO_STANDARD_LIBRARIES:=
LOCAL_NO_STATIC_ANALYZER:=
@@ -203,7 +201,6 @@
LOCAL_PREBUILT_MODULE_FILE:=
LOCAL_PREBUILT_OBJ_FILES:=
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:=
-LOCAL_PREBUILT_STRIP_COMMENTS:=
LOCAL_USE_EMBEDDED_DEX:=
LOCAL_USE_EMBEDDED_NATIVE_LIBS:=
LOCAL_PRESUBMIT_DISABLED:=
@@ -239,7 +236,6 @@
LOCAL_RES_LIBRARIES:=
LOCAL_RESOURCE_DIR:=
LOCAL_RLIB_LIBRARIES:=
-LOCAL_RMTYPEDEFS:=
LOCAL_ROTATION_MIN_SDK_VERSION:=
LOCAL_RUNTIME_LIBRARIES:=
LOCAL_RRO_THEME:=
@@ -313,8 +309,6 @@
LOCAL_VENDOR_MODULE:=
LOCAL_VINTF_FRAGMENTS:=
LOCAL_VNDK_DEPEND_ON_CORE_VARIANT:=
-LOCAL_VTS_INCLUDES:=
-LOCAL_VTS_MODE:=
LOCAL_WARNINGS_ENABLE:=
LOCAL_WHOLE_STATIC_LIBRARIES:=
LOCAL_YACCFLAGS:=
diff --git a/core/definitions.mk b/core/definitions.mk
index b14da6f..44643d9 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -3243,14 +3243,6 @@
$(hide) cp -p "$<" "$@"
endef
-# The same as copy-file-to-target, but strip out "# comment"-style
-# comments (for config files and such).
-define copy-file-to-target-strip-comments
-@mkdir -p $(dir $@)
-$(hide) rm -f $@
-$(hide) sed -e 's/#.*$$//' -e 's/[ \t]*$$//' -e '/^$$/d' < $< > $@
-endef
-
# The same as copy-file-to-target, but don't preserve
# the old modification time.
define copy-file-to-new-target
@@ -3285,12 +3277,6 @@
$(copy-file-to-target)
endef
-# Copy a prebuilt file to a target location, stripping "# comment" comments.
-define transform-prebuilt-to-target-strip-comments
-@echo "$($(PRIVATE_PREFIX)DISPLAY) Prebuilt: $(PRIVATE_MODULE) ($@)"
-$(copy-file-to-target-strip-comments)
-endef
-
# Copy a prebuilt file to a target location, but preserve symlinks rather than
# dereference them.
define copy-or-link-prebuilt-to-target
diff --git a/core/java_common.mk b/core/java_common.mk
index 7b27056..ec04718 100644
--- a/core/java_common.mk
+++ b/core/java_common.mk
@@ -238,8 +238,6 @@
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAVA_SOURCES := $(all_java_sources)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAVA_SOURCE_LIST := $(java_source_list_file)
-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RMTYPEDEFS := $(LOCAL_RMTYPEDEFS)
-
# Quickly check class path vars.
disallowed_deps := $(foreach sdk,$(TARGET_AVAILABLE_SDK_VERSIONS),$(call resolve-prebuilt-sdk-module,$(sdk)))
disallowed_deps += $(foreach sdk,$(TARGET_AVAILABLE_SDK_VERSIONS),\
diff --git a/core/java_prebuilt_internal.mk b/core/java_prebuilt_internal.mk
index be733ff..46393ac 100644
--- a/core/java_prebuilt_internal.mk
+++ b/core/java_prebuilt_internal.mk
@@ -115,11 +115,6 @@
ifneq ($(my_src_aar),)
# This is .aar file, archive of classes.jar and Android resources.
-# run Jetifier if needed
-LOCAL_JETIFIER_INPUT_FILE := $(my_src_aar)
-include $(BUILD_SYSTEM)/jetifier.mk
-my_src_aar := $(LOCAL_JETIFIER_OUTPUT_FILE)
-
my_src_jar := $(intermediates.COMMON)/aar/classes.jar
my_src_proguard_options := $(intermediates.COMMON)/aar/proguard.txt
my_src_android_manifest := $(intermediates.COMMON)/aar/AndroidManifest.xml
@@ -137,13 +132,6 @@
$(eval $(call copy-one-file,$(my_src_android_manifest),$(my_prebuilt_android_manifest)))
$(call add-dependency,$(LOCAL_BUILT_MODULE),$(my_prebuilt_android_manifest))
-else
-
-# run Jetifier if needed
-LOCAL_JETIFIER_INPUT_FILE := $(my_src_jar)
-include $(BUILD_SYSTEM)/jetifier.mk
-my_src_jar := $(LOCAL_JETIFIER_OUTPUT_FILE)
-
endif
$(common_classes_jar) : $(my_src_jar)
diff --git a/core/jetifier.mk b/core/jetifier.mk
deleted file mode 100644
index fff4230..0000000
--- a/core/jetifier.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (C) 2018 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# This file sets up the running of Jetifier
-
-# now add the rule to run jetifier
-ifeq ($(strip $(LOCAL_JETIFIER_ENABLED)),true)
- my_jetifier_input_path := $(LOCAL_JETIFIER_INPUT_FILE)
- my_files := $(intermediates.COMMON)/jetifier
- my_jetifier_output_path := $(my_files)/jetified-$(notdir $(my_jetifier_input_path))
-
-$(my_jetifier_output_path) : $(my_jetifier_input_path) $(JETIFIER)
- rm -rf $@
- $(JETIFIER) -l error -o $@ -i $<
-
- LOCAL_JETIFIER_OUTPUT_FILE := $(my_jetifier_output_path)
- LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_JETIFIER_OUTPUT_FILE)
-else
- LOCAL_JETIFIER_OUTPUT_FILE := $(LOCAL_JETIFIER_INPUT_FILE)
-endif
-
diff --git a/core/misc_prebuilt_internal.mk b/core/misc_prebuilt_internal.mk
index 921ea52..a562207 100644
--- a/core/misc_prebuilt_internal.mk
+++ b/core/misc_prebuilt_internal.mk
@@ -27,9 +27,6 @@
ifneq ($(filter init%rc,$(notdir $(LOCAL_INSTALLED_MODULE)))$(filter %/etc/init,$(dir $(LOCAL_INSTALLED_MODULE))),)
$(eval $(call copy-init-script-file-checked,$(my_prebuilt_src_file),$(LOCAL_BUILT_MODULE)))
-else ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
-$(LOCAL_BUILT_MODULE) : $(my_prebuilt_src_file)
- $(transform-prebuilt-to-target-strip-comments)
else
$(LOCAL_BUILT_MODULE) : $(my_prebuilt_src_file)
$(transform-prebuilt-to-target)