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# Build support for snakeyaml within the Android Open Source Project
18# See https://source.android.com/source/building.html for more information
19#
20
21LOCAL_PATH := $(call my-dir)
22
23# List of all files that need to be patched (see src/patches/android)
24snakeyaml_need_patch_src_files := \
25            src/main/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor.java \
26            src/main/java/org/yaml/snakeyaml/constructor/Constructor.java \
27            src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java \
28            src/main/java/org/yaml/snakeyaml/representer/Representer.java
29# List of all files that are unsupported on android (see pom.xml)
30snakeyaml_unsupported_android_src_files := \
31            src/main/java/org/yaml/snakeyaml/introspector/MethodProperty.java
32snakeyaml_src_files_unfiltered := $(call all-java-files-under, src/main)
33# We omit the list of files that need to be patched because those are included by LOCAL_GENERATED_SOURCES instead.
34snakeyaml_src_files := $(filter-out $(snakeyaml_need_patch_src_files) $(snakeyaml_unsupported_android_src_files),$(snakeyaml_src_files_unfiltered))
35
36# Target Java build
37include $(CLEAR_VARS)
38LOCAL_SRC_FILES := $(snakeyaml_src_files)
39LOCAL_MODULE := snakeyaml
40include $(LOCAL_PATH)/ApplyAndroidPatches.mk
41include $(BUILD_STATIC_JAVA_LIBRARY)
42
43# Host-side Java build
44include $(CLEAR_VARS)
45LOCAL_SRC_FILES := $(snakeyaml_src_files_unfiltered)
46LOCAL_MODULE := snakeyaml-host
47include $(BUILD_HOST_JAVA_LIBRARY)
48
49# Host-side Dalvik build
50include $(CLEAR_VARS)
51LOCAL_SRC_FILES := $(snakeyaml_src_files)
52LOCAL_MODULE := snakeyaml-hostdex
53include $(LOCAL_PATH)/ApplyAndroidPatches.mk
54include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
55
56# TODO: Consider adding tests.
57