blob: 695d6baab16beced82eeb591143c91ef829843da [file] [log] [blame]
#
# 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.
#
###########################################################################
# Inspects Support Library dependencies and adds transitive dependencies.
#
# Exports the following variables:
# support_android_deps
# support_java_deps
#
# This file was automatically generated with:
# $command
###########################################################################
# Only AAPT2 clients get transitive dependency resolution. This may be removed
# once we've migrated all Support Library targets to LOCAL_AAPT2_ONLY := true.
ifeq ($$(LOCAL_USE_AAPT2),true)
known_support_libs :=$known
# Don't run on the Support Library targets themselves.
ifeq (,$$(filter $$(known_support_libs), $$(LOCAL_MODULE)))
# Aggregate all requested Support Library modules.
requested_support_libs := $$(filter $$(known_support_libs), \
$$(LOCAL_JAVA_LIBRARIES) $$(LOCAL_STATIC_JAVA_LIBRARIES) \
$$(LOCAL_SHARED_ANDROID_LIBRARIES) $$(LOCAL_STATIC_ANDROID_LIBRARIES))
# Filter the Support Library modules out of the library variables. We don't
# trust developers to get these right, so they will be added back by the
# build system based on the output of this file and the type of build.
LOCAL_JAVA_LIBRARIES := $$(filter-out $$(requested_support_libs), \
$$(LOCAL_JAVA_LIBRARIES))
LOCAL_STATIC_JAVA_LIBRARIES := $$(filter-out $$(requested_support_libs), \
$$(LOCAL_STATIC_JAVA_LIBRARIES))
LOCAL_SHARED_ANDROID_LIBRARIES := $$(filter-out $$(requested_support_libs), \
$$(LOCAL_SHARED_ANDROID_LIBRARIES))
LOCAL_STATIC_ANDROID_LIBRARIES := $$(filter-out $$(requested_support_libs), \
$$(LOCAL_STATIC_ANDROID_LIBRARIES))
support_android_deps :=
support_java_deps :=
$rules
# Remove duplicates so that soong doesn't choke on "Argument list too long"
define uniq
$$(eval seen :=)
$$(foreach _,$$1,$$(if $$(filter $$_,$${seen}),,$$(eval seen += $$_)))
$${seen}
endef
ifdef support_android_deps
support_android_deps := $$(call uniq,$$(support_android_deps))
endif #support_android_deps
ifdef support_java_deps
support_java_deps := $$(call uniq,$$(support_java_deps))
endif #support_java_deps
requested_support_libs :=
endif #IS_SUPPORT_LIBRARY
known_support_libs :=
endif #LOCAL_USE_AAPT2