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