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