Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2014 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 | |
| 17 | // ========================================================== |
| 18 | // Setup some common variables for the different build |
| 19 | // targets here. |
| 20 | // ========================================================== |
| 21 | |
Bob Badour | 8a6a2bc | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 22 | package { |
| 23 | default_applicable_licenses: ["frameworks_base_tools_aapt_license"], |
| 24 | } |
| 25 | |
| 26 | // Added automatically by a large-scale-change |
| 27 | // See: http://go/android-license-faq |
| 28 | license { |
| 29 | name: "frameworks_base_tools_aapt_license", |
| 30 | visibility: [":__subpackages__"], |
| 31 | license_kinds: [ |
| 32 | "SPDX-license-identifier-Apache-2.0", |
| 33 | ], |
| 34 | license_text: [ |
| 35 | "NOTICE", |
| 36 | ], |
| 37 | } |
| 38 | |
Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 39 | cc_defaults { |
| 40 | name: "aapt_defaults", |
| 41 | |
| 42 | static_libs: [ |
| 43 | "libandroidfw", |
| 44 | "libpng", |
| 45 | "libutils", |
| 46 | "liblog", |
| 47 | "libcutils", |
| 48 | "libexpat", |
| 49 | "libziparchive", |
| 50 | "libbase", |
| 51 | "libz", |
| 52 | ], |
Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 53 | |
Tomasz Wasilczyk | 804e819 | 2023-08-23 02:22:53 +0000 | [diff] [blame] | 54 | whole_static_libs: [ |
| 55 | "libandroidfw_pathutils", |
| 56 | ], |
| 57 | |
Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 58 | cflags: [ |
| 59 | "-Wall", |
| 60 | "-Werror", |
| 61 | ], |
| 62 | |
| 63 | target: { |
| 64 | windows: { |
| 65 | enabled: true, |
| 66 | }, |
| 67 | }, |
Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | // ========================================================== |
| 71 | // Build the host static library: libaapt |
| 72 | // ========================================================== |
| 73 | cc_library_host_static { |
| 74 | name: "libaapt", |
| 75 | defaults: ["aapt_defaults"], |
| 76 | target: { |
| 77 | darwin: { |
| 78 | cflags: ["-D_DARWIN_UNLIMITED_STREAMS"], |
| 79 | }, |
| 80 | }, |
| 81 | cflags: [ |
| 82 | "-Wno-format-y2k", |
| 83 | "-DSTATIC_ANDROIDFW_FOR_TOOLS", |
| 84 | ], |
| 85 | |
| 86 | srcs: [ |
| 87 | "AaptAssets.cpp", |
| 88 | "AaptConfig.cpp", |
| 89 | "AaptUtil.cpp", |
| 90 | "AaptXml.cpp", |
| 91 | "ApkBuilder.cpp", |
| 92 | "Command.cpp", |
| 93 | "CrunchCache.cpp", |
| 94 | "FileFinder.cpp", |
| 95 | "Images.cpp", |
| 96 | "Package.cpp", |
| 97 | "pseudolocalize.cpp", |
| 98 | "Resource.cpp", |
| 99 | "ResourceFilter.cpp", |
| 100 | "ResourceIdCache.cpp", |
| 101 | "ResourceTable.cpp", |
| 102 | "SourcePos.cpp", |
| 103 | "StringPool.cpp", |
Elliott Hughes | 338698e | 2021-07-13 17:15:19 -0700 | [diff] [blame] | 104 | "Utils.cpp", |
Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 105 | "WorkQueue.cpp", |
| 106 | "XMLNode.cpp", |
| 107 | "ZipEntry.cpp", |
| 108 | "ZipFile.cpp", |
| 109 | ], |
| 110 | } |
| 111 | |
| 112 | // ========================================================== |
Dan Willemsen | 5d12935 | 2018-08-29 17:22:14 -0700 | [diff] [blame] | 113 | // Build the host executable: aapt |
| 114 | // ========================================================== |
| 115 | cc_binary_host { |
| 116 | name: "aapt", |
| 117 | defaults: ["aapt_defaults"], |
| 118 | srcs: ["Main.cpp"], |
| 119 | use_version_lib: true, |
| 120 | static_libs: ["libaapt"], |
Ryan Mitchell | c3d6932 | 2021-05-04 07:42:46 -0700 | [diff] [blame] | 121 | dist: { |
| 122 | targets: ["aapt2_artifacts"], |
| 123 | }, |
Dan Willemsen | 5d12935 | 2018-08-29 17:22:14 -0700 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | // ========================================================== |
Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 127 | // Build the host tests: libaapt_tests |
| 128 | // ========================================================== |
| 129 | cc_test_host { |
| 130 | name: "libaapt_tests", |
| 131 | defaults: ["aapt_defaults"], |
| 132 | srcs: [ |
| 133 | "tests/AaptConfig_test.cpp", |
| 134 | "tests/AaptGroupEntry_test.cpp", |
| 135 | "tests/Pseudolocales_test.cpp", |
| 136 | "tests/ResourceFilter_test.cpp", |
| 137 | "tests/ResourceTable_test.cpp", |
| 138 | ], |
| 139 | static_libs: ["libaapt"], |
| 140 | } |