# # Copyright (C) 2008 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. #
# Standard rules for building a "static" java library. # Static java libraries are not installed, nor listed on any # classpaths. They can, however, be included wholesale in # other java modules.
# By default we should remove the R/Manifest classes from a static Java library, # because they will be regenerated in the app that uses it. # But if the static Java library will be used by a library, then we may need to # keep the generated classes with "LOCAL_JAR_EXCLUDE_FILES := none".
ifndef LOCAL_JAR_EXCLUDE_FILES
LOCAL_JAR_EXCLUDE_FILES := $(ANDROID_RESOURCE_GENERATED_CLASSES) endif ifeq (none,$(LOCAL_JAR_EXCLUDE_FILES))
LOCAL_JAR_EXCLUDE_FILES := endif
ifneq ($(strip $(LOCAL_STATIC_ANDROID_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES)),) # If we are using static android libraries, every source file becomes an overlay. # This is to emulate old AAPT behavior which simulated library support.
my_res_resources :=
my_overlay_resources := $(all_resources) else # Otherwise, for a library we treat all the resource equal with no overlay.
my_res_resources := $(all_resources)
my_overlay_resources := endif # For libraries put everything in the COMMON intermediate directory.
my_res_package := $(intermediates.COMMON)/package-res.apk
LOCAL_INTERMEDIATE_TARGETS += $(my_res_package)
endif# need_compile_res
all_res_assets := $(all_resources)
include $(BUILD_SYSTEM)/java_renderscript.mk
ifeq (true,$(need_compile_res)) # work around missing manifests by creating a default one ifeq (,$(strip $(LOCAL_MANIFEST_FILE)$(LOCAL_FULL_MANIFEST_FILE))) ifeq (,$(wildcard $(LOCAL_PATH)/AndroidManifest.xml))
LOCAL_FULL_MANIFEST_FILE := $(call local-intermediates-dir,COMMON)/DefaultManifest.xml
$(call create-default-manifest-file,$(LOCAL_FULL_MANIFEST_FILE),$(call module-min-sdk-version)) endif endif include $(BUILD_SYSTEM)/android_manifest.mk
# transitive-res-packages is only populated for Soong modules for now, but needs # to exist so that other Make modules can depend on it. Create an empty file.
my_transitive_res_packages := $(intermediates.COMMON)/transitive-res-packages
$(my_transitive_res_packages):
touch $@
import_proguard_flag_files := $(strip $(foreach l,$(LOCAL_STATIC_ANDROID_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
$(call intermediates-dir-for,JAVA_LIBRARIES,$(l),,COMMON)/export_proguard_flags))
$(intermediates.COMMON)/export_proguard_flags: $(import_proguard_flag_files) $(addprefix $(LOCAL_PATH)/,$(LOCAL_EXPORT_PROGUARD_FLAG_FILES))
@echo"Export proguard flags: $@" rm -f $@
touch $@ for f in $+; do \ echo -e "\n# including $$f" >>$@; \ cat $$f >>$@; \ done
import_proguard_flag_files :=
# One more level with name res so we can zip up the flat resources that can be linked by apps.
my_compiled_res_base_dir := $(intermediates.COMMON)/flat-res/res ifneq (,$(filter-out current,$(renderscript_target_api))) ifneq ($(call math_gt_or_eq,$(renderscript_target_api),21),true)
my_generated_res_zips := $(rs_generated_res_zip) endif# renderscript_target_api < 21 endif# renderscript_target_api is set include $(BUILD_SYSTEM)/aapt2.mk
$(my_res_package) : $(framework_res_package_export)
$(my_res_package): .KATI_IMPLICIT_OUTPUTS += $(intermediates.COMMON)/R.txt
# if we have custom proguarding done use the proguarded classes jar instead of the normal classes jar ifeq ($(filter custom,$(LOCAL_PROGUARD_ENABLED)),custom)
aar_classes_jar = $(full_classes_jar) else
aar_classes_jar = $(full_classes_pre_proguard_jar) endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.