1# Copyright (C) 2016 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16#
17# Apply the android patches in src/patches/android
18# - Required in order to build correctly for AOSP.
19#
20
21#
22# Input variables:
23# (Constant)
24# -- snakeyaml_need_patch_src_files: List of .java files that will need to be patched.
25#
26# This mk file will automatically look up the corresponding patch in src/patches/android
27# and apply it to every file in $(snakeyaml_need_patch_src_files).
28#
29
30LOCAL_MODULE_CLASS := JAVA_LIBRARIES
31
32# Apply all of the Android patches in src/patches/android by running patch-android-src script on them.
33intermediates:= $(local-generated-sources-dir)
34GEN := $(addprefix $(intermediates)/, $(snakeyaml_need_patch_src_files)) # List of all files that need to be patched.
35$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
36$(GEN) : PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/patch-android-src $(PRIVATE_PATH)/ $< $@
37$(GEN): $(intermediates)/%.java : $(LOCAL_PATH)/%.java $(LOCAL_PATH)/patch-android-src
38	$(transform-generated-source)
39LOCAL_GENERATED_SOURCES += $(GEN)
40