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, |
Stephen Hines | 328a29c | 2020-06-09 00:14:52 -0700 | [diff] [blame] | 18 | tidy_checks: [ |
| 19 | "modernize-*", |
| 20 | "-modernize-avoid-c-arrays", |
| 21 | "-modernize-use-trailing-return-type", |
| 22 | "android-*", |
| 23 | "misc-*", |
| 24 | "readability-*", |
| 25 | ], |
Stephen Hines | ab17065 | 2020-06-09 00:13:57 -0700 | [diff] [blame] | 26 | tidy_checks_as_errors: [ |
Ryan Mitchell | 1982345 | 2019-01-29 12:01:24 -0800 | [diff] [blame] | 27 | "modernize-*", |
| 28 | "-modernize-avoid-c-arrays", |
Yi Kong | fbafa51 | 2019-07-27 14:43:50 -0700 | [diff] [blame] | 29 | "-modernize-use-trailing-return-type", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 30 | "android-*", |
| 31 | "misc-*", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 32 | "readability-*", |
| 33 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 34 | tidy_flags: [ |
| 35 | "-system-headers", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 36 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | cc_library { |
| 40 | name: "libidmap2", |
| 41 | defaults: [ |
| 42 | "idmap2_defaults", |
| 43 | ], |
| 44 | host_supported: true, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 45 | srcs: [ |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 46 | "libidmap2/**/*.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 47 | ], |
| 48 | export_include_dirs: ["include"], |
| 49 | target: { |
| 50 | android: { |
| 51 | static: { |
| 52 | enabled: false, |
| 53 | }, |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 54 | static_libs: [ |
| 55 | "libidmap2_protos", |
| 56 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 57 | shared_libs: [ |
| 58 | "libandroidfw", |
| 59 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 60 | "libcutils", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 61 | "libidmap2_policies", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 62 | "libprotobuf-cpp-lite", |
| 63 | "libutils", |
| 64 | "libz", |
| 65 | "libziparchive", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 66 | ], |
| 67 | }, |
| 68 | host: { |
| 69 | shared: { |
| 70 | enabled: false, |
| 71 | }, |
| 72 | static_libs: [ |
| 73 | "libandroidfw", |
| 74 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 75 | "libcutils", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 76 | "libidmap2_policies", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 77 | "libidmap2_protos", |
| 78 | "libprotobuf-cpp-lite", |
| 79 | "libutils", |
| 80 | "libz", |
| 81 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 82 | ], |
| 83 | }, |
| 84 | }, |
| 85 | } |
| 86 | |
| 87 | cc_library { |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 88 | name: "libidmap2_protos", |
| 89 | srcs: [ |
| 90 | "libidmap2/proto/*.proto", |
| 91 | ], |
| 92 | host_supported: true, |
| 93 | proto: { |
| 94 | type: "lite", |
| 95 | export_proto_headers: true, |
| 96 | }, |
| 97 | } |
| 98 | |
| 99 | cc_library { |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 100 | name: "libidmap2_policies", |
| 101 | defaults: [ |
| 102 | "idmap2_defaults", |
| 103 | ], |
| 104 | host_supported: true, |
| 105 | export_include_dirs: ["libidmap2_policies/include"], |
| 106 | target: { |
| 107 | windows: { |
| 108 | enabled: true, |
| 109 | }, |
| 110 | android: { |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 111 | shared_libs: [ |
| 112 | "libandroidfw", |
| 113 | ], |
| 114 | }, |
| 115 | host: { |
| 116 | shared: { |
| 117 | enabled: false, |
| 118 | }, |
| 119 | static_libs: [ |
| 120 | "libandroidfw", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 121 | ], |
| 122 | }, |
| 123 | }, |
| 124 | } |
| 125 | |
| 126 | cc_test { |
| 127 | name: "idmap2_tests", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 128 | defaults: [ |
| 129 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 130 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 131 | tidy_checks: [ |
| 132 | "-readability-magic-numbers", |
| 133 | ], |
| 134 | host_supported: true, |
Ryan Mitchell | bcc179a | 2019-03-29 14:55:51 -0700 | [diff] [blame] | 135 | test_suites: ["general-tests"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 136 | srcs: [ |
| 137 | "tests/BinaryStreamVisitorTests.cpp", |
| 138 | "tests/CommandLineOptionsTests.cpp", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 139 | "tests/FabricatedOverlayTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 140 | "tests/FileUtilsTests.cpp", |
| 141 | "tests/Idmap2BinaryTests.cpp", |
| 142 | "tests/IdmapTests.cpp", |
| 143 | "tests/Main.cpp", |
Mårten Kongstad | d10d06d | 2019-01-07 17:26:25 -0800 | [diff] [blame] | 144 | "tests/PoliciesTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 145 | "tests/PrettyPrintVisitorTests.cpp", |
| 146 | "tests/RawPrintVisitorTests.cpp", |
Ryan Mitchell | 9e4f52b | 2019-09-19 12:15:52 -0700 | [diff] [blame] | 147 | "tests/ResourceMappingTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 148 | "tests/ResourceUtilsTests.cpp", |
Mårten Kongstad | 1e99b17 | 2019-01-28 08:49:12 +0100 | [diff] [blame] | 149 | "tests/ResultTests.cpp", |
Ryan Mitchell | cd965a3 | 2019-09-18 14:52:45 -0700 | [diff] [blame] | 150 | "tests/XmlParserTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 151 | ], |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 152 | required: [ |
| 153 | "idmap2", |
| 154 | ], |
| 155 | static_libs: [ |
| 156 | "libgmock", |
| 157 | "libidmap2_protos", |
| 158 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 159 | target: { |
| 160 | android: { |
| 161 | shared_libs: [ |
| 162 | "libandroidfw", |
| 163 | "libbase", |
| 164 | "libidmap2", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 165 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 166 | "liblog", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 167 | "libprotobuf-cpp-lite", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 168 | "libutils", |
| 169 | "libz", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 170 | "libz", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 171 | "libziparchive", |
| 172 | ], |
| 173 | }, |
| 174 | host: { |
| 175 | static_libs: [ |
| 176 | "libandroidfw", |
| 177 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 178 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 179 | "libidmap2", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 180 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 181 | "liblog", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 182 | "libprotobuf-cpp-lite", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 183 | "libutils", |
| 184 | "libziparchive", |
| 185 | ], |
| 186 | shared_libs: [ |
| 187 | "libz", |
| 188 | ], |
Julien Desprez | 91e0330 | 2021-02-08 16:46:08 -0800 | [diff] [blame] | 189 | data: [ |
| 190 | ":libz", |
| 191 | ":idmap2", |
| 192 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 193 | }, |
| 194 | }, |
Julien Desprez | 91e0330 | 2021-02-08 16:46:08 -0800 | [diff] [blame] | 195 | data: [ |
| 196 | "tests/data/**/*.apk", |
| 197 | ], |
| 198 | compile_multilib: "first", |
| 199 | test_options: { |
| 200 | unit_test: true, |
| 201 | }, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | cc_binary { |
| 205 | name: "idmap2", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 206 | defaults: [ |
| 207 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 208 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 209 | host_supported: true, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 210 | srcs: [ |
Ryan Mitchell | a707013 | 2020-05-13 14:17:52 -0700 | [diff] [blame] | 211 | "idmap2/CommandUtils.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 212 | "idmap2/Create.cpp", |
Ryan Mitchell | 9b93942 | 2020-02-04 10:18:53 -0800 | [diff] [blame] | 213 | "idmap2/CreateMultiple.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 214 | "idmap2/Dump.cpp", |
| 215 | "idmap2/Lookup.cpp", |
| 216 | "idmap2/Main.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 217 | ], |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 218 | static_libs: [ |
| 219 | "libidmap2_protos", |
| 220 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 221 | target: { |
| 222 | android: { |
| 223 | shared_libs: [ |
| 224 | "libandroidfw", |
| 225 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 226 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 227 | "libidmap2", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 228 | "libidmap2_policies", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 229 | "libprotobuf-cpp-lite", |
| 230 | "libutils", |
| 231 | "libz", |
| 232 | "libziparchive", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 233 | ], |
| 234 | }, |
| 235 | host: { |
| 236 | static_libs: [ |
| 237 | "libandroidfw", |
| 238 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 239 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 240 | "libidmap2", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 241 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 242 | "liblog", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 243 | "libprotobuf-cpp-lite", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 244 | "libutils", |
| 245 | "libziparchive", |
| 246 | ], |
| 247 | shared_libs: [ |
| 248 | "libz", |
| 249 | ], |
| 250 | }, |
| 251 | }, |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 252 | |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | cc_binary { |
| 256 | name: "idmap2d", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 257 | defaults: [ |
| 258 | "idmap2_defaults", |
| 259 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 260 | host_supported: false, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 261 | srcs: [ |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 262 | "idmap2d/Idmap2Service.cpp", |
| 263 | "idmap2d/Main.cpp", |
| 264 | ], |
| 265 | shared_libs: [ |
| 266 | "libandroidfw", |
| 267 | "libbase", |
| 268 | "libbinder", |
| 269 | "libcutils", |
| 270 | "libidmap2", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 271 | "libidmap2_policies", |
| 272 | "libprotobuf-cpp-lite", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 273 | "libutils", |
| 274 | "libziparchive", |
| 275 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 276 | static_libs: [ |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 277 | "libc++fs", |
Ryan Mitchell | 2ed8bfa | 2021-01-08 13:34:28 -0800 | [diff] [blame] | 278 | "libidmap2_protos", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 279 | "libidmap2daidl", |
| 280 | ], |
Mårten Kongstad | b87b5072 | 2018-09-21 09:58:10 +0200 | [diff] [blame] | 281 | init_rc: ["idmap2d/idmap2d.rc"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 282 | } |
| 283 | |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 284 | cc_library_static { |
| 285 | name: "libidmap2daidl", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 286 | srcs: [ |
| 287 | ":idmap2_aidl", |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 288 | ":idmap2_core_aidl", |
| 289 | ], |
| 290 | header_libs: [ |
| 291 | "libbinder_headers", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 292 | ], |
| 293 | shared_libs: [ |
| 294 | "libbase", |
| 295 | ], |
| 296 | aidl: { |
| 297 | export_aidl_headers: true, |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 298 | local_include_dirs: [ |
| 299 | "idmap2d/aidl/core", |
| 300 | "idmap2d/aidl/services/", |
| 301 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 302 | }, |
| 303 | } |
| 304 | |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 305 | filegroup { |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 306 | name: "idmap2_core_aidl", |
| 307 | srcs: [ |
| 308 | "idmap2d/aidl/core/android/os/FabricatedOverlayInternal.aidl", |
| 309 | "idmap2d/aidl/core/android/os/FabricatedOverlayInternalEntry.aidl", |
| 310 | "idmap2d/aidl/core/android/os/FabricatedOverlayInfo.aidl", |
| 311 | ], |
| 312 | path: "idmap2d/aidl/core/", |
| 313 | } |
| 314 | |
| 315 | filegroup { |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 316 | name: "idmap2_aidl", |
| 317 | srcs: [ |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 318 | "idmap2d/aidl/services/android/os/IIdmap2.aidl", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 319 | ], |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 320 | path: "idmap2d/aidl/services/", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 321 | } |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 322 | |
| 323 | aidl_interface { |
| 324 | name: "overlayable_policy_aidl", |
Jiyong Park | db589dd | 2020-04-13 12:55:24 +0900 | [diff] [blame] | 325 | unstable: true, |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 326 | srcs: [":overlayable_policy_aidl_files"], |
| 327 | } |
| 328 | |
| 329 | filegroup { |
| 330 | name: "overlayable_policy_aidl_files", |
| 331 | srcs: [ |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 332 | "idmap2d/aidl/services/android/os/OverlayablePolicy.aidl", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 333 | ], |
Ryan Mitchell | 6a2ca78 | 2021-01-19 13:51:15 -0800 | [diff] [blame^] | 334 | path: "idmap2d/aidl/services/", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 335 | } |