blob: e204cc4156005fbfa608c619ea9112bd5a208620 [file] [log] [blame]
Alan Viverettefb8f5ba2018-02-21 11:44:57 -05001#
2# Copyright (C) 2018 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17###########################################################
18## Rules for resolving Support Library dependencies.
19##
20## The following variables may be modified:
21## - LOCAL_JAVA_LIBRARIES
22## - LOCAL_STATIC_JAVA_LIBRARIES
23## - LOCAL_SHARED_ANDROID_LIBRARIES
24## - LOCAL_STATIC_ANDROID_LIBRARIES
25###########################################################
26
27# Some projects don't work correctly yet. Allow them to skip resolution.
28ifndef LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES
29
30# Clear these out so we don't accidentally get old values.
31support_android_deps :=
32support_java_deps :=
33
34# Delegate dependency expansion to the Support Library's rules. This will store
35# its output in the variables support_android_deps and support_java_deps.
36include $(RESOLVE_SUPPORT_LIBRARIES)
37
38# Store the expanded dependencies in the appropriate variables. Libraries
39# should NEVER statically include Support Library modules with resources.
40ifdef support_android_deps
41 ifdef LOCAL_IS_STATIC_JAVA_LIBRARY
42 LOCAL_SHARED_ANDROID_LIBRARIES += $(support_android_deps)
43 else
44 LOCAL_STATIC_ANDROID_LIBRARIES += $(support_android_deps)
45 endif # LOCAL_IS_STATIC_JAVA_LIBRARY
46endif #support_android_deps
47LOCAL_STATIC_JAVA_LIBRARIES += $(support_java_deps)
48
49# We have consumed these values. Clean them up.
50support_android_deps :=
51support_java_deps :=
52
53endif #LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES
54LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES :=