Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 1 | // Copyright (C) 2018 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 | |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 15 | cc_defaults { |
| 16 | name: "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 17 | tidy: true, |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 18 | tidy_checks: [ |
Ryan Mitchell | 1982345 | 2019-01-29 12:01:24 -0800 | [diff] [blame] | 19 | "modernize-*", |
| 20 | "-modernize-avoid-c-arrays", |
Yi Kong | fbafa51 | 2019-07-27 14:43:50 -0700 | [diff] [blame] | 21 | "-modernize-use-trailing-return-type", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 22 | "android-*", |
| 23 | "misc-*", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 24 | "readability-*", |
| 25 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 26 | tidy_flags: [ |
| 27 | "-system-headers", |
Todd Kennedy | 044803f | 2018-12-21 15:10:16 -0800 | [diff] [blame] | 28 | "-warnings-as-errors=*", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 29 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | cc_library { |
| 33 | name: "libidmap2", |
| 34 | defaults: [ |
| 35 | "idmap2_defaults", |
| 36 | ], |
| 37 | host_supported: true, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 38 | srcs: [ |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 39 | "libidmap2/**/*.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 40 | ], |
| 41 | export_include_dirs: ["include"], |
| 42 | target: { |
| 43 | android: { |
| 44 | static: { |
| 45 | enabled: false, |
| 46 | }, |
| 47 | shared_libs: [ |
| 48 | "libandroidfw", |
| 49 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 50 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 51 | "libutils", |
| 52 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 53 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 54 | ], |
| 55 | }, |
| 56 | host: { |
| 57 | shared: { |
| 58 | enabled: false, |
| 59 | }, |
| 60 | static_libs: [ |
| 61 | "libandroidfw", |
| 62 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 63 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 64 | "libutils", |
| 65 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 66 | "libidmap2_policies", |
| 67 | ], |
| 68 | }, |
| 69 | }, |
| 70 | } |
| 71 | |
| 72 | cc_library { |
| 73 | name: "libidmap2_policies", |
| 74 | defaults: [ |
| 75 | "idmap2_defaults", |
| 76 | ], |
| 77 | host_supported: true, |
| 78 | export_include_dirs: ["libidmap2_policies/include"], |
| 79 | target: { |
| 80 | windows: { |
| 81 | enabled: true, |
| 82 | }, |
| 83 | android: { |
| 84 | static: { |
| 85 | enabled: false, |
| 86 | }, |
| 87 | shared_libs: [ |
| 88 | "libandroidfw", |
| 89 | ], |
| 90 | }, |
| 91 | host: { |
| 92 | shared: { |
| 93 | enabled: false, |
| 94 | }, |
| 95 | static_libs: [ |
| 96 | "libandroidfw", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 97 | ], |
| 98 | }, |
| 99 | }, |
| 100 | } |
| 101 | |
| 102 | cc_test { |
| 103 | name: "idmap2_tests", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 104 | defaults: [ |
| 105 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 106 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 107 | tidy_checks: [ |
| 108 | "-readability-magic-numbers", |
| 109 | ], |
| 110 | host_supported: true, |
Ryan Mitchell | bcc179a | 2019-03-29 14:55:51 -0700 | [diff] [blame] | 111 | test_suites: ["general-tests"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 112 | srcs: [ |
| 113 | "tests/BinaryStreamVisitorTests.cpp", |
| 114 | "tests/CommandLineOptionsTests.cpp", |
| 115 | "tests/FileUtilsTests.cpp", |
| 116 | "tests/Idmap2BinaryTests.cpp", |
| 117 | "tests/IdmapTests.cpp", |
| 118 | "tests/Main.cpp", |
Mårten Kongstad | d10d06d | 2019-01-07 17:26:25 -0800 | [diff] [blame] | 119 | "tests/PoliciesTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 120 | "tests/PrettyPrintVisitorTests.cpp", |
| 121 | "tests/RawPrintVisitorTests.cpp", |
Ryan Mitchell | 9e4f52b | 2019-09-19 12:15:52 -0700 | [diff] [blame] | 122 | "tests/ResourceMappingTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 123 | "tests/ResourceUtilsTests.cpp", |
Mårten Kongstad | 1e99b17 | 2019-01-28 08:49:12 +0100 | [diff] [blame] | 124 | "tests/ResultTests.cpp", |
Ryan Mitchell | cd965a3 | 2019-09-18 14:52:45 -0700 | [diff] [blame] | 125 | "tests/XmlParserTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 126 | "tests/ZipFileTests.cpp", |
| 127 | ], |
| 128 | required: [ |
| 129 | "idmap2", |
| 130 | ], |
| 131 | static_libs: ["libgmock"], |
| 132 | target: { |
| 133 | android: { |
| 134 | shared_libs: [ |
| 135 | "libandroidfw", |
| 136 | "libbase", |
| 137 | "libidmap2", |
| 138 | "liblog", |
| 139 | "libutils", |
| 140 | "libz", |
| 141 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 142 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 143 | ], |
| 144 | }, |
| 145 | host: { |
| 146 | static_libs: [ |
| 147 | "libandroidfw", |
| 148 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 149 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 150 | "libidmap2", |
| 151 | "liblog", |
| 152 | "libutils", |
| 153 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 154 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 155 | ], |
| 156 | shared_libs: [ |
| 157 | "libz", |
| 158 | ], |
| 159 | }, |
| 160 | }, |
| 161 | data: ["tests/data/**/*.apk"], |
| 162 | } |
| 163 | |
| 164 | cc_binary { |
| 165 | name: "idmap2", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 166 | defaults: [ |
| 167 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 168 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 169 | host_supported: true, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 170 | srcs: [ |
| 171 | "idmap2/Create.cpp", |
Ryan Mitchell | 9b93942 | 2020-02-04 10:18:53 -0800 | [diff] [blame] | 172 | "idmap2/CreateMultiple.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 173 | "idmap2/Dump.cpp", |
| 174 | "idmap2/Lookup.cpp", |
| 175 | "idmap2/Main.cpp", |
| 176 | "idmap2/Scan.cpp", |
| 177 | "idmap2/Verify.cpp", |
| 178 | ], |
| 179 | target: { |
| 180 | android: { |
| 181 | shared_libs: [ |
| 182 | "libandroidfw", |
| 183 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 184 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 185 | "libidmap2", |
| 186 | "libutils", |
| 187 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 188 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 189 | ], |
| 190 | }, |
| 191 | host: { |
| 192 | static_libs: [ |
| 193 | "libandroidfw", |
| 194 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 195 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 196 | "libidmap2", |
| 197 | "liblog", |
| 198 | "libutils", |
| 199 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 200 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 201 | ], |
| 202 | shared_libs: [ |
| 203 | "libz", |
| 204 | ], |
| 205 | }, |
| 206 | }, |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 207 | |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | cc_binary { |
| 211 | name: "idmap2d", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 212 | defaults: [ |
| 213 | "idmap2_defaults", |
| 214 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 215 | host_supported: false, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 216 | srcs: [ |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 217 | "idmap2d/Idmap2Service.cpp", |
| 218 | "idmap2d/Main.cpp", |
| 219 | ], |
| 220 | shared_libs: [ |
| 221 | "libandroidfw", |
| 222 | "libbase", |
| 223 | "libbinder", |
| 224 | "libcutils", |
| 225 | "libidmap2", |
| 226 | "libutils", |
| 227 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 228 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 229 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 230 | static_libs: [ |
| 231 | "libidmap2daidl", |
| 232 | ], |
Mårten Kongstad | b87b5072 | 2018-09-21 09:58:10 +0200 | [diff] [blame] | 233 | init_rc: ["idmap2d/idmap2d.rc"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 234 | } |
| 235 | |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 236 | cc_library_static { |
| 237 | name: "libidmap2daidl", |
| 238 | defaults: [ |
| 239 | "idmap2_defaults", |
| 240 | ], |
| 241 | tidy: false, |
| 242 | host_supported: false, |
| 243 | srcs: [ |
| 244 | ":idmap2_aidl", |
| 245 | ], |
| 246 | shared_libs: [ |
| 247 | "libbase", |
| 248 | ], |
| 249 | aidl: { |
| 250 | export_aidl_headers: true, |
| 251 | }, |
| 252 | } |
| 253 | |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 254 | filegroup { |
| 255 | name: "idmap2_aidl", |
| 256 | srcs: [ |
| 257 | "idmap2d/aidl/android/os/IIdmap2.aidl", |
| 258 | ], |
Dan Willemsen | d1a5aa6 | 2019-06-08 08:42:07 -0700 | [diff] [blame] | 259 | path: "idmap2d/aidl", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 260 | } |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame^] | 261 | |
| 262 | aidl_interface { |
| 263 | name: "overlayable_policy_aidl", |
| 264 | srcs: [":overlayable_policy_aidl_files"], |
| 265 | } |
| 266 | |
| 267 | filegroup { |
| 268 | name: "overlayable_policy_aidl_files", |
| 269 | srcs: [ |
| 270 | "idmap2d/aidl/android/os/OverlayablePolicy.aidl", |
| 271 | ], |
| 272 | path: "idmap2d/aidl", |
| 273 | } |