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