blob: e21a6b288fb3cb77727903920fdc54ded40a0bd3 [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 ],
135 required: [
136 "idmap2",
137 ],
138 static_libs: ["libgmock"],
139 target: {
140 android: {
141 shared_libs: [
142 "libandroidfw",
143 "libbase",
144 "libidmap2",
145 "liblog",
146 "libutils",
147 "libz",
148 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800149 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200150 ],
151 },
152 host: {
153 static_libs: [
154 "libandroidfw",
155 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700156 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200157 "libidmap2",
158 "liblog",
159 "libutils",
160 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800161 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200162 ],
163 shared_libs: [
164 "libz",
165 ],
166 },
167 },
168 data: ["tests/data/**/*.apk"],
169}
170
171cc_binary {
172 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100173 defaults: [
174 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200175 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100176 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200177 srcs: [
Ryan Mitchella7070132020-05-13 14:17:52 -0700178 "idmap2/CommandUtils.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200179 "idmap2/Create.cpp",
Ryan Mitchell9b939422020-02-04 10:18:53 -0800180 "idmap2/CreateMultiple.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200181 "idmap2/Dump.cpp",
182 "idmap2/Lookup.cpp",
183 "idmap2/Main.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200184 ],
185 target: {
186 android: {
187 shared_libs: [
188 "libandroidfw",
189 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100190 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200191 "libidmap2",
192 "libutils",
193 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800194 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200195 ],
196 },
197 host: {
198 static_libs: [
199 "libandroidfw",
200 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700201 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200202 "libidmap2",
203 "liblog",
204 "libutils",
205 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800206 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200207 ],
208 shared_libs: [
209 "libz",
210 ],
211 },
212 },
Winson62ac8b52019-12-04 08:36:48 -0800213
Mårten Kongstad02751232018-04-27 13:16:32 +0200214}
215
216cc_binary {
217 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100218 defaults: [
219 "idmap2_defaults",
220 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200221 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200222 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200223 "idmap2d/Idmap2Service.cpp",
224 "idmap2d/Main.cpp",
225 ],
226 shared_libs: [
227 "libandroidfw",
228 "libbase",
229 "libbinder",
230 "libcutils",
231 "libidmap2",
232 "libutils",
233 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800234 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200235 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100236 static_libs: [
237 "libidmap2daidl",
238 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200239 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200240}
241
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100242cc_library_static {
243 name: "libidmap2daidl",
244 defaults: [
245 "idmap2_defaults",
246 ],
247 tidy: false,
248 host_supported: false,
249 srcs: [
250 ":idmap2_aidl",
251 ],
252 shared_libs: [
253 "libbase",
254 ],
255 aidl: {
256 export_aidl_headers: true,
257 },
258}
259
Mårten Kongstad02751232018-04-27 13:16:32 +0200260filegroup {
261 name: "idmap2_aidl",
262 srcs: [
263 "idmap2d/aidl/android/os/IIdmap2.aidl",
264 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700265 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200266}
Winson62ac8b52019-12-04 08:36:48 -0800267
268aidl_interface {
269 name: "overlayable_policy_aidl",
Jiyong Parkdb589dd2020-04-13 12:55:24 +0900270 unstable: true,
Winson62ac8b52019-12-04 08:36:48 -0800271 srcs: [":overlayable_policy_aidl_files"],
272}
273
274filegroup {
275 name: "overlayable_policy_aidl_files",
276 srcs: [
277 "idmap2d/aidl/android/os/OverlayablePolicy.aidl",
278 ],
279 path: "idmap2d/aidl",
280}