| Alan Viverette | fb8f5ba | 2018-02-21 11:44:57 -0500 | [diff] [blame] | 1 | # | 
|  | 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. | 
|  | 28 | ifndef LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES | 
|  | 29 |  | 
| Colin Cross | 8560930 | 2018-04-19 14:20:19 -0700 | [diff] [blame] | 30 | # Aggregate all requested Support Library modules. | 
|  | 31 | requested_support_libs := $(filter $(SUPPORT_LIBRARIES_JARS) $(SUPPORT_LIBRARIES_AARS), \ | 
|  | 32 | $(LOCAL_JAVA_LIBRARIES) $(LOCAL_STATIC_JAVA_LIBRARIES) \ | 
|  | 33 | $(LOCAL_SHARED_ANDROID_LIBRARIES) $(LOCAL_STATIC_ANDROID_LIBRARIES)) | 
| Alan Viverette | fb8f5ba | 2018-02-21 11:44:57 -0500 | [diff] [blame] | 34 |  | 
| Colin Cross | 8560930 | 2018-04-19 14:20:19 -0700 | [diff] [blame] | 35 | # Filter the Support Library modules out of the library variables. We don't | 
|  | 36 | # trust developers to get these right, so they will be added back by the | 
|  | 37 | # build system based on the output of this file and the type of build. | 
|  | 38 | LOCAL_JAVA_LIBRARIES := $(filter-out $(requested_support_libs), \ | 
|  | 39 | $(LOCAL_JAVA_LIBRARIES)) | 
|  | 40 | LOCAL_STATIC_JAVA_LIBRARIES := $(filter-out $(requested_support_libs), \ | 
|  | 41 | $(LOCAL_STATIC_JAVA_LIBRARIES)) | 
|  | 42 | LOCAL_SHARED_ANDROID_LIBRARIES := $(filter-out $(requested_support_libs), \ | 
|  | 43 | $(LOCAL_SHARED_ANDROID_LIBRARIES)) | 
|  | 44 | LOCAL_STATIC_ANDROID_LIBRARIES := $(filter-out $(requested_support_libs), \ | 
|  | 45 | $(LOCAL_STATIC_ANDROID_LIBRARIES)) | 
| Alan Viverette | fb8f5ba | 2018-02-21 11:44:57 -0500 | [diff] [blame] | 46 |  | 
| Colin Cross | 8560930 | 2018-04-19 14:20:19 -0700 | [diff] [blame] | 47 | LOCAL_STATIC_ANDROID_LIBRARIES := $(strip $(LOCAL_STATIC_ANDROID_LIBRARIES) \ | 
|  | 48 | $(filter $(SUPPORT_LIBRARIES_AARS),$(requested_support_libs))) | 
|  | 49 | LOCAL_STATIC_JAVA_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_LIBRARIES) \ | 
|  | 50 | $(filter $(SUPPORT_LIBRARIES_JARS),$(requested_support_libs))) | 
| Alan Viverette | fb8f5ba | 2018-02-21 11:44:57 -0500 | [diff] [blame] | 51 |  | 
|  | 52 | endif #LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES | 
|  | 53 | LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES := |