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: [ |
| 46 | "libidmap2/BinaryStreamVisitor.cpp", |
| 47 | "libidmap2/CommandLineOptions.cpp", |
| 48 | "libidmap2/FileUtils.cpp", |
| 49 | "libidmap2/Idmap.cpp", |
Mårten Kongstad | d10d06d | 2019-01-07 17:26:25 -0800 | [diff] [blame] | 50 | "libidmap2/Policies.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 51 | "libidmap2/PrettyPrintVisitor.cpp", |
| 52 | "libidmap2/RawPrintVisitor.cpp", |
| 53 | "libidmap2/ResourceUtils.cpp", |
Mårten Kongstad | 1e99b17 | 2019-01-28 08:49:12 +0100 | [diff] [blame] | 54 | "libidmap2/Result.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 55 | "libidmap2/Xml.cpp", |
| 56 | "libidmap2/ZipFile.cpp", |
| 57 | ], |
| 58 | export_include_dirs: ["include"], |
| 59 | target: { |
| 60 | android: { |
| 61 | static: { |
| 62 | enabled: false, |
| 63 | }, |
| 64 | shared_libs: [ |
| 65 | "libandroidfw", |
| 66 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 67 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 68 | "libutils", |
| 69 | "libziparchive", |
| 70 | ], |
| 71 | }, |
| 72 | host: { |
| 73 | shared: { |
| 74 | enabled: false, |
| 75 | }, |
| 76 | static_libs: [ |
| 77 | "libandroidfw", |
| 78 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 79 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 80 | "libutils", |
| 81 | "libziparchive", |
| 82 | ], |
| 83 | }, |
| 84 | }, |
| 85 | } |
| 86 | |
| 87 | cc_test { |
| 88 | name: "idmap2_tests", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 89 | defaults: [ |
| 90 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 91 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 92 | tidy_checks: [ |
| 93 | "-readability-magic-numbers", |
| 94 | ], |
| 95 | host_supported: true, |
Ryan Mitchell | bcc179a | 2019-03-29 14:55:51 -0700 | [diff] [blame] | 96 | test_suites: ["general-tests"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 97 | srcs: [ |
| 98 | "tests/BinaryStreamVisitorTests.cpp", |
| 99 | "tests/CommandLineOptionsTests.cpp", |
| 100 | "tests/FileUtilsTests.cpp", |
| 101 | "tests/Idmap2BinaryTests.cpp", |
| 102 | "tests/IdmapTests.cpp", |
| 103 | "tests/Main.cpp", |
Mårten Kongstad | d10d06d | 2019-01-07 17:26:25 -0800 | [diff] [blame] | 104 | "tests/PoliciesTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 105 | "tests/PrettyPrintVisitorTests.cpp", |
| 106 | "tests/RawPrintVisitorTests.cpp", |
| 107 | "tests/ResourceUtilsTests.cpp", |
Mårten Kongstad | 1e99b17 | 2019-01-28 08:49:12 +0100 | [diff] [blame] | 108 | "tests/ResultTests.cpp", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 109 | "tests/XmlTests.cpp", |
| 110 | "tests/ZipFileTests.cpp", |
| 111 | ], |
| 112 | required: [ |
| 113 | "idmap2", |
| 114 | ], |
| 115 | static_libs: ["libgmock"], |
| 116 | target: { |
| 117 | android: { |
| 118 | shared_libs: [ |
| 119 | "libandroidfw", |
| 120 | "libbase", |
| 121 | "libidmap2", |
| 122 | "liblog", |
| 123 | "libutils", |
| 124 | "libz", |
| 125 | "libziparchive", |
| 126 | ], |
| 127 | }, |
| 128 | host: { |
| 129 | static_libs: [ |
| 130 | "libandroidfw", |
| 131 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 132 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 133 | "libidmap2", |
| 134 | "liblog", |
| 135 | "libutils", |
| 136 | "libziparchive", |
| 137 | ], |
| 138 | shared_libs: [ |
| 139 | "libz", |
| 140 | ], |
| 141 | }, |
| 142 | }, |
| 143 | data: ["tests/data/**/*.apk"], |
| 144 | } |
| 145 | |
| 146 | cc_binary { |
| 147 | name: "idmap2", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 148 | defaults: [ |
| 149 | "idmap2_defaults", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 150 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 151 | host_supported: true, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 152 | srcs: [ |
| 153 | "idmap2/Create.cpp", |
| 154 | "idmap2/Dump.cpp", |
| 155 | "idmap2/Lookup.cpp", |
| 156 | "idmap2/Main.cpp", |
| 157 | "idmap2/Scan.cpp", |
| 158 | "idmap2/Verify.cpp", |
| 159 | ], |
| 160 | target: { |
| 161 | android: { |
| 162 | shared_libs: [ |
| 163 | "libandroidfw", |
| 164 | "libbase", |
Mårten Kongstad | 4cbb007 | 2018-11-30 16:22:05 +0100 | [diff] [blame] | 165 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 166 | "libidmap2", |
| 167 | "libutils", |
| 168 | "libziparchive", |
| 169 | ], |
| 170 | }, |
| 171 | host: { |
| 172 | static_libs: [ |
| 173 | "libandroidfw", |
| 174 | "libbase", |
Steven Moreland | 598bda8 | 2019-09-18 12:58:11 -0700 | [diff] [blame] | 175 | "libcutils", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 176 | "libidmap2", |
| 177 | "liblog", |
| 178 | "libutils", |
| 179 | "libziparchive", |
| 180 | ], |
| 181 | shared_libs: [ |
| 182 | "libz", |
| 183 | ], |
| 184 | }, |
| 185 | }, |
| 186 | } |
| 187 | |
| 188 | cc_binary { |
| 189 | name: "idmap2d", |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 190 | defaults: [ |
| 191 | "idmap2_defaults", |
| 192 | ], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 193 | host_supported: false, |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 194 | srcs: [ |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 195 | "idmap2d/Idmap2Service.cpp", |
| 196 | "idmap2d/Main.cpp", |
| 197 | ], |
| 198 | shared_libs: [ |
| 199 | "libandroidfw", |
| 200 | "libbase", |
| 201 | "libbinder", |
| 202 | "libcutils", |
| 203 | "libidmap2", |
| 204 | "libutils", |
| 205 | "libziparchive", |
| 206 | ], |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 207 | static_libs: [ |
| 208 | "libidmap2daidl", |
| 209 | ], |
Mårten Kongstad | b87b5072 | 2018-09-21 09:58:10 +0200 | [diff] [blame] | 210 | init_rc: ["idmap2d/idmap2d.rc"], |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 211 | } |
| 212 | |
Mårten Kongstad | 3c9bc61 | 2018-11-19 08:26:16 +0100 | [diff] [blame] | 213 | cc_library_static { |
| 214 | name: "libidmap2daidl", |
| 215 | defaults: [ |
| 216 | "idmap2_defaults", |
| 217 | ], |
| 218 | tidy: false, |
| 219 | host_supported: false, |
| 220 | srcs: [ |
| 221 | ":idmap2_aidl", |
| 222 | ], |
| 223 | shared_libs: [ |
| 224 | "libbase", |
| 225 | ], |
| 226 | aidl: { |
| 227 | export_aidl_headers: true, |
| 228 | }, |
| 229 | } |
| 230 | |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 231 | filegroup { |
| 232 | name: "idmap2_aidl", |
| 233 | srcs: [ |
| 234 | "idmap2d/aidl/android/os/IIdmap2.aidl", |
| 235 | ], |
Dan Willemsen | d1a5aa6 | 2019-06-08 08:42:07 -0700 | [diff] [blame] | 236 | path: "idmap2d/aidl", |
Mårten Kongstad | 0275123 | 2018-04-27 13:16:32 +0200 | [diff] [blame] | 237 | } |