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