1cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# Copyright (C) 2016 The Android Open Source Project 2cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# 3cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# Licensed under the Apache License, Version 2.0 (the "License"); 4cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# you may not use this file except in compliance with the License. 5cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# You may obtain a copy of the License at 6cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# 7cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# http://www.apache.org/licenses/LICENSE-2.0 8cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# 9cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# Unless required by applicable law or agreed to in writing, software 10cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# distributed under the License is distributed on an "AS IS" BASIS, 11cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# See the License for the specific language governing permissions and 13cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# limitations under the License. 14cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# 15cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin 16cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# 17cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# Build support for snakeyaml within the Android Open Source Project 18cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# See https://source.android.com/source/building.html for more information 19cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# 20cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin 21cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor MurashkinLOCAL_PATH := $(call my-dir) 22cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin 23cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# List of all files that need to be patched (see src/patches/android) 24cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkinsnakeyaml_need_patch_src_files := \ 25cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin src/main/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor.java \ 26cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin src/main/java/org/yaml/snakeyaml/constructor/Constructor.java \ 27cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin src/main/java/org/yaml/snakeyaml/introspector/PropertyUtils.java \ 28cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin src/main/java/org/yaml/snakeyaml/representer/Representer.java 29cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# List of all files that are unsupported on android (see pom.xml) 30cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkinsnakeyaml_unsupported_android_src_files := \ 31cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin src/main/java/org/yaml/snakeyaml/introspector/MethodProperty.java 32cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkinsnakeyaml_src_files_unfiltered := $(call all-java-files-under, src/main) 33cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# We omit the list of files that need to be patched because those are included by LOCAL_GENERATED_SOURCES instead. 34cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkinsnakeyaml_src_files := $(filter-out $(snakeyaml_need_patch_src_files) $(snakeyaml_unsupported_android_src_files),$(snakeyaml_src_files_unfiltered)) 35cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin 3605152a01decfcca5cef87e3768852a751e2c67b3Igor Murashkin# Target Java build 3705152a01decfcca5cef87e3768852a751e2c67b3Igor Murashkininclude $(CLEAR_VARS) 3805152a01decfcca5cef87e3768852a751e2c67b3Igor MurashkinLOCAL_SRC_FILES := $(snakeyaml_src_files) 3905152a01decfcca5cef87e3768852a751e2c67b3Igor MurashkinLOCAL_MODULE := snakeyaml 4005152a01decfcca5cef87e3768852a751e2c67b3Igor Murashkininclude $(LOCAL_PATH)/ApplyAndroidPatches.mk 4105152a01decfcca5cef87e3768852a751e2c67b3Igor Murashkininclude $(BUILD_STATIC_JAVA_LIBRARY) 4205152a01decfcca5cef87e3768852a751e2c67b3Igor Murashkin 43cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# Host-side Java build 44cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkininclude $(CLEAR_VARS) 45cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor MurashkinLOCAL_SRC_FILES := $(snakeyaml_src_files_unfiltered) 46cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor MurashkinLOCAL_MODULE := snakeyaml-host 47cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkininclude $(BUILD_HOST_JAVA_LIBRARY) 48cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin 49cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# Host-side Dalvik build 50cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkininclude $(CLEAR_VARS) 51cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor MurashkinLOCAL_SRC_FILES := $(snakeyaml_src_files) 52cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor MurashkinLOCAL_MODULE := snakeyaml-hostdex 5305152a01decfcca5cef87e3768852a751e2c67b3Igor Murashkininclude $(LOCAL_PATH)/ApplyAndroidPatches.mk 54cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkininclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 55cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin 56cce31f6de8fea06821a8b57a9c0d2c687c8161f5Igor Murashkin# TODO: Consider adding tests. 57