blob: 50f400122fe1b3d01d4e89e64a2c2aab11a5d2ae [file] [log] [blame]
Mårten Kongstad02751232018-04-27 13:16:32 +02001// 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 Kongstad3c9bc612018-11-19 08:26:16 +010015cc_defaults {
16 name: "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020017 tidy: true,
Stephen Hines328a29c2020-06-09 00:14:52 -070018 tidy_checks: [
19 "modernize-*",
20 "-modernize-avoid-c-arrays",
21 "-modernize-use-trailing-return-type",
22 "android-*",
23 "misc-*",
24 "readability-*",
25 ],
Stephen Hinesab170652020-06-09 00:13:57 -070026 tidy_checks_as_errors: [
Ryan Mitchell19823452019-01-29 12:01:24 -080027 "modernize-*",
28 "-modernize-avoid-c-arrays",
Yi Kongfbafa512019-07-27 14:43:50 -070029 "-modernize-use-trailing-return-type",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010030 "android-*",
31 "misc-*",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010032 "readability-*",
33 ],
Mårten Kongstad02751232018-04-27 13:16:32 +020034 tidy_flags: [
35 "-system-headers",
Mårten Kongstad02751232018-04-27 13:16:32 +020036 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010037}
38
39cc_library {
40 name: "libidmap2",
41 defaults: [
42 "idmap2_defaults",
43 ],
44 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020045 srcs: [
Winson62ac8b52019-12-04 08:36:48 -080046 "libidmap2/**/*.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020047 ],
48 export_include_dirs: ["include"],
49 target: {
50 android: {
51 static: {
52 enabled: false,
53 },
54 shared_libs: [
55 "libandroidfw",
56 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +010057 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020058 "libutils",
59 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -080060 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +020061 ],
62 },
63 host: {
64 shared: {
65 enabled: false,
66 },
67 static_libs: [
68 "libandroidfw",
69 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -070070 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020071 "libutils",
72 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -080073 "libidmap2_policies",
74 ],
75 },
76 },
77}
78
79cc_library {
80 name: "libidmap2_policies",
81 defaults: [
82 "idmap2_defaults",
83 ],
84 host_supported: true,
85 export_include_dirs: ["libidmap2_policies/include"],
86 target: {
87 windows: {
88 enabled: true,
89 },
90 android: {
91 static: {
92 enabled: false,
93 },
94 shared_libs: [
95 "libandroidfw",
96 ],
97 },
98 host: {
99 shared: {
100 enabled: false,
101 },
102 static_libs: [
103 "libandroidfw",
Mårten Kongstad02751232018-04-27 13:16:32 +0200104 ],
105 },
106 },
107}
108
109cc_test {
110 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100111 defaults: [
112 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200113 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100114 tidy_checks: [
115 "-readability-magic-numbers",
116 ],
117 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -0700118 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200119 srcs: [
120 "tests/BinaryStreamVisitorTests.cpp",
121 "tests/CommandLineOptionsTests.cpp",
122 "tests/FileUtilsTests.cpp",
123 "tests/Idmap2BinaryTests.cpp",
124 "tests/IdmapTests.cpp",
125 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -0800126 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200127 "tests/PrettyPrintVisitorTests.cpp",
128 "tests/RawPrintVisitorTests.cpp",
Ryan Mitchell9e4f52b2019-09-19 12:15:52 -0700129 "tests/ResourceMappingTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200130 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +0100131 "tests/ResultTests.cpp",
Ryan Mitchellcd965a32019-09-18 14:52:45 -0700132 "tests/XmlParserTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200133 "tests/ZipFileTests.cpp",
134 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200135 static_libs: ["libgmock"],
136 target: {
137 android: {
138 shared_libs: [
139 "libandroidfw",
140 "libbase",
141 "libidmap2",
142 "liblog",
143 "libutils",
144 "libz",
145 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800146 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200147 ],
148 },
149 host: {
150 static_libs: [
151 "libandroidfw",
152 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700153 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200154 "libidmap2",
155 "liblog",
156 "libutils",
157 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800158 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200159 ],
160 shared_libs: [
161 "libz",
162 ],
Julien Desprez91e03302021-02-08 16:46:08 -0800163 data: [
164 ":libz",
165 ":idmap2",
166 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200167 },
168 },
Julien Desprez91e03302021-02-08 16:46:08 -0800169 data: [
170 "tests/data/**/*.apk",
171 ],
172 compile_multilib: "first",
173 test_options: {
174 unit_test: true,
175 },
Mårten Kongstad02751232018-04-27 13:16:32 +0200176}
177
178cc_binary {
179 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100180 defaults: [
181 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200182 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100183 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200184 srcs: [
Ryan Mitchella7070132020-05-13 14:17:52 -0700185 "idmap2/CommandUtils.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200186 "idmap2/Create.cpp",
Ryan Mitchell9b939422020-02-04 10:18:53 -0800187 "idmap2/CreateMultiple.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200188 "idmap2/Dump.cpp",
189 "idmap2/Lookup.cpp",
190 "idmap2/Main.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200191 ],
192 target: {
193 android: {
194 shared_libs: [
195 "libandroidfw",
196 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100197 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200198 "libidmap2",
199 "libutils",
200 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800201 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200202 ],
203 },
204 host: {
205 static_libs: [
206 "libandroidfw",
207 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700208 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200209 "libidmap2",
210 "liblog",
211 "libutils",
212 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800213 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200214 ],
215 shared_libs: [
216 "libz",
217 ],
218 },
219 },
Winson62ac8b52019-12-04 08:36:48 -0800220
Mårten Kongstad02751232018-04-27 13:16:32 +0200221}
222
223cc_binary {
224 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100225 defaults: [
226 "idmap2_defaults",
227 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200228 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200229 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200230 "idmap2d/Idmap2Service.cpp",
231 "idmap2d/Main.cpp",
232 ],
233 shared_libs: [
234 "libandroidfw",
235 "libbase",
236 "libbinder",
237 "libcutils",
238 "libidmap2",
239 "libutils",
240 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800241 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200242 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100243 static_libs: [
244 "libidmap2daidl",
245 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200246 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200247}
248
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100249cc_library_static {
250 name: "libidmap2daidl",
251 defaults: [
252 "idmap2_defaults",
253 ],
254 tidy: false,
255 host_supported: false,
256 srcs: [
257 ":idmap2_aidl",
258 ],
259 shared_libs: [
260 "libbase",
261 ],
262 aidl: {
263 export_aidl_headers: true,
264 },
265}
266
Mårten Kongstad02751232018-04-27 13:16:32 +0200267filegroup {
268 name: "idmap2_aidl",
269 srcs: [
270 "idmap2d/aidl/android/os/IIdmap2.aidl",
271 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700272 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200273}
Winson62ac8b52019-12-04 08:36:48 -0800274
275aidl_interface {
276 name: "overlayable_policy_aidl",
Jiyong Parkdb589dd2020-04-13 12:55:24 +0900277 unstable: true,
Winson62ac8b52019-12-04 08:36:48 -0800278 srcs: [":overlayable_policy_aidl_files"],
279}
280
281filegroup {
282 name: "overlayable_policy_aidl_files",
283 srcs: [
284 "idmap2d/aidl/android/os/OverlayablePolicy.aidl",
285 ],
286 path: "idmap2d/aidl",
287}