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 | |
Bob Badour | 051ef78 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 15 | package { |
| 16 | // See: http://go/android-license-faq |
| 17 | // A large-scale-change added 'default_applicable_licenses' to import |
| 18 | // all of the 'license_kinds' from "frameworks_base_license" |
| 19 | // to get the below license kinds: |
| 20 | // SPDX-license-identifier-Apache-2.0 |
| 21 | default_applicable_licenses: ["frameworks_base_license"], |
| 22 | } |
| 23 | |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 24 | cc_defaults { |
| 25 | name: "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 26 | tidy: true, |
Stephen Hines | 328a29c | 2020-06-09 00:14:52 -0700 | [diff] [blame] | 27 | tidy_checks: [ |
| 28 | "modernize-*", |
| 29 | "-modernize-avoid-c-arrays", |
| 30 | "-modernize-use-trailing-return-type", |
| 31 | "android-*", |
| 32 | "misc-*", |
| 33 | "readability-*", |
| 34 | ], |
Stephen Hines | ab17065 | 2020-06-09 00:13:57 -0700 | [diff] [blame] | 35 | tidy_checks_as_errors: [ |
Ryan Mitchell | 1982345 | 2019-01-29 12:01:24 -0800 | [diff] [blame] | 36 | "modernize-*", |
| 37 | "-modernize-avoid-c-arrays", |
Chih-Hung Hsieh | 14d955f | 2021-02-11 11:52:15 -0800 | [diff] [blame] | 38 | "-modernize-pass-by-value", |
| 39 | "-modernize-replace-disallow-copy-and-assign-macro", |
| 40 | "-modernize-use-equals-default", |
| 41 | "-modernize-use-nodiscard", |
| 42 | "-modernize-use-override", |
Yi Kong | fbafa51 | 2019-07-27 14:43:50 -0700 | [diff] [blame] | 43 | "-modernize-use-trailing-return-type", |
Chih-Hung Hsieh | 14d955f | 2021-02-11 11:52:15 -0800 | [diff] [blame] | 44 | "-modernize-use-using", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 45 | "android-*", |
| 46 | "misc-*", |
Chih-Hung Hsieh | 14d955f | 2021-02-11 11:52:15 -0800 | [diff] [blame] | 47 | "-misc-non-private-member-variables-in-classes", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 48 | "readability-*", |
Chih-Hung Hsieh | 14d955f | 2021-02-11 11:52:15 -0800 | [diff] [blame] | 49 | "-readability-braces-around-statements", |
| 50 | "-readability-const-return-type", |
| 51 | "-readability-convert-member-functions-to-static", |
| 52 | "-readability-else-after-return", |
| 53 | "-readability-named-parameter", |
| 54 | "-readability-redundant-access-specifiers", |
| 55 | "-readability-uppercase-literal-suffix", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 56 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 57 | tidy_flags: [ |
| 58 | "-system-headers", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 59 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | cc_library { |
| 63 | name: "libidmap2", |
| 64 | defaults: [ |
| 65 | "idmap2_defaults", |
| 66 | ], |
| 67 | host_supported: true, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 68 | srcs: [ |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 69 | "libidmap2/**/*.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 70 | ], |
| 71 | export_include_dirs: ["include"], |
| 72 | target: { |
| 73 | android: { |
| 74 | static: { |
| 75 | enabled: false, |
| 76 | }, |
| 77 | shared_libs: [ |
| 78 | "libandroidfw", |
| 79 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 80 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 81 | "libutils", |
| 82 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 83 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 84 | ], |
| 85 | }, |
| 86 | host: { |
| 87 | shared: { |
| 88 | enabled: false, |
| 89 | }, |
| 90 | static_libs: [ |
| 91 | "libandroidfw", |
| 92 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 93 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 94 | "libutils", |
| 95 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 96 | "libidmap2_policies", |
| 97 | ], |
| 98 | }, |
| 99 | }, |
| 100 | } |
| 101 | |
| 102 | cc_library { |
| 103 | name: "libidmap2_policies", |
| 104 | defaults: [ |
| 105 | "idmap2_defaults", |
| 106 | ], |
| 107 | host_supported: true, |
| 108 | export_include_dirs: ["libidmap2_policies/include"], |
| 109 | target: { |
| 110 | windows: { |
| 111 | enabled: true, |
| 112 | }, |
| 113 | android: { |
| 114 | static: { |
| 115 | enabled: false, |
| 116 | }, |
| 117 | shared_libs: [ |
| 118 | "libandroidfw", |
| 119 | ], |
| 120 | }, |
| 121 | host: { |
| 122 | shared: { |
| 123 | enabled: false, |
| 124 | }, |
| 125 | static_libs: [ |
| 126 | "libandroidfw", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 127 | ], |
| 128 | }, |
| 129 | }, |
| 130 | } |
| 131 | |
| 132 | cc_test { |
| 133 | name: "idmap2_tests", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 134 | defaults: [ |
| 135 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 136 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 137 | tidy_checks: [ |
| 138 | "-readability-magic-numbers", |
| 139 | ], |
| 140 | host_supported: true, |
Ryan Mitchell | bcc179a | 2019-03-29 14:55:51 -0700 | [diff] [blame] | 141 | test_suites: ["general-tests"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 142 | srcs: [ |
| 143 | "tests/BinaryStreamVisitorTests.cpp", |
| 144 | "tests/CommandLineOptionsTests.cpp", |
| 145 | "tests/FileUtilsTests.cpp", |
| 146 | "tests/Idmap2BinaryTests.cpp", |
| 147 | "tests/IdmapTests.cpp", |
| 148 | "tests/Main.cpp", |
Mårten Kongstad | d10d06d | 2019-01-07 17:26:25 -0800 | [diff] [blame] | 149 | "tests/PoliciesTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 150 | "tests/PrettyPrintVisitorTests.cpp", |
| 151 | "tests/RawPrintVisitorTests.cpp", |
Ryan Mitchell | 9e4f52b | 2019-09-19 12:15:52 -0700 | [diff] [blame] | 152 | "tests/ResourceMappingTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 153 | "tests/ResourceUtilsTests.cpp", |
Mårten Kongstad | 1e99b17 | 2019-01-28 08:49:12 +0100 | [diff] [blame] | 154 | "tests/ResultTests.cpp", |
Ryan Mitchell | cd965a3 | 2019-09-18 14:52:45 -0700 | [diff] [blame] | 155 | "tests/XmlParserTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 156 | "tests/ZipFileTests.cpp", |
| 157 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 158 | static_libs: ["libgmock"], |
| 159 | target: { |
| 160 | android: { |
| 161 | shared_libs: [ |
| 162 | "libandroidfw", |
| 163 | "libbase", |
| 164 | "libidmap2", |
| 165 | "liblog", |
| 166 | "libutils", |
| 167 | "libz", |
| 168 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 169 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 170 | ], |
| 171 | }, |
| 172 | host: { |
| 173 | static_libs: [ |
| 174 | "libandroidfw", |
| 175 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 176 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 177 | "libidmap2", |
| 178 | "liblog", |
| 179 | "libutils", |
| 180 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 181 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 182 | ], |
| 183 | shared_libs: [ |
| 184 | "libz", |
| 185 | ], |
Julien Desprez | 91e0330 | 2021-02-08 16:46:08 -0800 | [diff] [blame] | 186 | data: [ |
| 187 | ":libz", |
| 188 | ":idmap2", |
| 189 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 190 | }, |
| 191 | }, |
Julien Desprez | 91e0330 | 2021-02-08 16:46:08 -0800 | [diff] [blame] | 192 | data: [ |
| 193 | "tests/data/**/*.apk", |
| 194 | ], |
| 195 | compile_multilib: "first", |
| 196 | test_options: { |
| 197 | unit_test: true, |
| 198 | }, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | cc_binary { |
| 202 | name: "idmap2", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 203 | defaults: [ |
| 204 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 205 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 206 | host_supported: true, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 207 | srcs: [ |
Ryan Mitchell | a707013 | 2020-05-13 14:17:52 -0700 | [diff] [blame] | 208 | "idmap2/CommandUtils.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 209 | "idmap2/Create.cpp", |
Ryan Mitchell | 9b93942 | 2020-02-04 10:18:53 -0800 | [diff] [blame] | 210 | "idmap2/CreateMultiple.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 211 | "idmap2/Dump.cpp", |
| 212 | "idmap2/Lookup.cpp", |
| 213 | "idmap2/Main.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 214 | ], |
| 215 | target: { |
| 216 | android: { |
| 217 | shared_libs: [ |
| 218 | "libandroidfw", |
| 219 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 220 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 221 | "libidmap2", |
| 222 | "libutils", |
| 223 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 224 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 225 | ], |
| 226 | }, |
| 227 | host: { |
| 228 | static_libs: [ |
| 229 | "libandroidfw", |
| 230 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 231 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 232 | "libidmap2", |
| 233 | "liblog", |
| 234 | "libutils", |
| 235 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 236 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 237 | ], |
| 238 | shared_libs: [ |
| 239 | "libz", |
| 240 | ], |
| 241 | }, |
| 242 | }, |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 243 | |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | cc_binary { |
| 247 | name: "idmap2d", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 248 | defaults: [ |
| 249 | "idmap2_defaults", |
| 250 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 251 | host_supported: false, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 252 | srcs: [ |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 253 | "idmap2d/Idmap2Service.cpp", |
| 254 | "idmap2d/Main.cpp", |
| 255 | ], |
| 256 | shared_libs: [ |
| 257 | "libandroidfw", |
| 258 | "libbase", |
| 259 | "libbinder", |
| 260 | "libcutils", |
| 261 | "libidmap2", |
| 262 | "libutils", |
| 263 | "libziparchive", |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 264 | "libidmap2_policies", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 265 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 266 | static_libs: [ |
| 267 | "libidmap2daidl", |
| 268 | ], |
Mårten Kongstad | b87b5072 | 2018-09-21 09:58:10 +0200 | [diff] [blame] | 269 | init_rc: ["idmap2d/idmap2d.rc"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 270 | } |
| 271 | |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 272 | cc_library_static { |
| 273 | name: "libidmap2daidl", |
| 274 | defaults: [ |
| 275 | "idmap2_defaults", |
| 276 | ], |
| 277 | tidy: false, |
| 278 | host_supported: false, |
| 279 | srcs: [ |
| 280 | ":idmap2_aidl", |
| 281 | ], |
| 282 | shared_libs: [ |
| 283 | "libbase", |
| 284 | ], |
| 285 | aidl: { |
| 286 | export_aidl_headers: true, |
| 287 | }, |
| 288 | } |
| 289 | |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 290 | filegroup { |
| 291 | name: "idmap2_aidl", |
| 292 | srcs: [ |
| 293 | "idmap2d/aidl/android/os/IIdmap2.aidl", |
| 294 | ], |
Dan Willemsen | d1a5aa6 | 2019-06-08 08:42:07 -0700 | [diff] [blame] | 295 | path: "idmap2d/aidl", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 296 | } |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 297 | |
| 298 | aidl_interface { |
| 299 | name: "overlayable_policy_aidl", |
Jiyong Park | db589dd | 2020-04-13 12:55:24 +0900 | [diff] [blame] | 300 | unstable: true, |
Winson | 62ac8b5 | 2019-12-04 08:36:48 -0800 | [diff] [blame] | 301 | srcs: [":overlayable_policy_aidl_files"], |
| 302 | } |
| 303 | |
| 304 | filegroup { |
| 305 | name: "overlayable_policy_aidl_files", |
| 306 | srcs: [ |
| 307 | "idmap2d/aidl/android/os/OverlayablePolicy.aidl", |
| 308 | ], |
| 309 | path: "idmap2d/aidl", |
| 310 | } |