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