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 17cc_defaults { 18 name: "viewcompiler_defaults", 19 header_libs: [ 20 "libbase_headers", 21 ], 22 shared_libs: [ 23 "libbase", 24 "slicer", 25 ], 26 static_libs: [ 27 "libcutils", 28 "libtinyxml2", 29 "liblog", 30 "libutils", 31 "libziparchive", 32 "libz", 33 ], 34 cppflags: ["-std=c++17"], 35 target: { 36 android: { 37 shared_libs: [ 38 "libandroidfw", 39 ], 40 }, 41 host: { 42 static_libs: [ 43 "libandroidfw", 44 ], 45 }, 46 }, 47} 48 49cc_library_static { 50 name: "libviewcompiler", 51 defaults: ["viewcompiler_defaults"], 52 srcs: [ 53 "apk_layout_compiler.cc", 54 "dex_builder.cc", 55 "dex_layout_compiler.cc", 56 "java_lang_builder.cc", 57 "tinyxml_layout_parser.cc", 58 "util.cc", 59 "layout_validation.cc", 60 ], 61 host_supported: true, 62} 63 64cc_binary { 65 name: "viewcompiler", 66 defaults: ["viewcompiler_defaults"], 67 srcs: [ 68 "main.cc", 69 ], 70 static_libs: [ 71 "libgflags", 72 "libviewcompiler", 73 ], 74 host_supported: true 75} 76 77cc_test_host { 78 name: "view-compiler-tests", 79 defaults: ["viewcompiler_defaults"], 80 srcs: [ 81 "layout_validation_test.cc", 82 "util_test.cc", 83 ], 84 static_libs: [ 85 "libviewcompiler", 86 ], 87 test_suites: ["general-tests"], 88} 89 90cc_binary_host { 91 name: "dex_testcase_generator", 92 defaults: ["viewcompiler_defaults"], 93 srcs: ["dex_testcase_generator.cc"], 94 static_libs: [ 95 "libviewcompiler", 96 ], 97} 98 99genrule { 100 name: "generate_dex_testcases", 101 tools: [":dex_testcase_generator"], 102 cmd: "$(location :dex_testcase_generator) $(genDir)", 103 out: [ 104 "simple.dex", 105 "trivial.dex", 106 ], 107} 108