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