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 21 LOCAL_PATH := $(call my-dir) 22 23 # List of all files that need to be patched (see src/patches/android) 24 snakeyaml_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) 30 snakeyaml_unsupported_android_src_files := \ 31 src/main/java/org/yaml/snakeyaml/introspector/MethodProperty.java 32 snakeyaml_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. 34 snakeyaml_src_files := $(filter-out $(snakeyaml_need_patch_src_files) $(snakeyaml_unsupported_android_src_files),$(snakeyaml_src_files_unfiltered)) 35 36 # Target Java build 37 include $(CLEAR_VARS) 38 LOCAL_SRC_FILES := $(snakeyaml_src_files) 39 LOCAL_MODULE := snakeyaml 40 include $(LOCAL_PATH)/ApplyAndroidPatches.mk 41 include $(BUILD_STATIC_JAVA_LIBRARY) 42 43 # Host-side Java build 44 include $(CLEAR_VARS) 45 LOCAL_SRC_FILES := $(snakeyaml_src_files_unfiltered) 46 LOCAL_MODULE := snakeyaml-host 47 include $(BUILD_HOST_JAVA_LIBRARY) 48 49 # Host-side Dalvik build 50 include $(CLEAR_VARS) 51 LOCAL_SRC_FILES := $(snakeyaml_src_files) 52 LOCAL_MODULE := snakeyaml-hostdex 53 include $(LOCAL_PATH)/ApplyAndroidPatches.mk 54 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 55 56 # TODO: Consider adding tests. 57