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