blob: 8d272321aa64259bc1584e262621e298a0af353f [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
Bob Badour051ef782021-02-12 17:07:05 -080015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "frameworks_base_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["frameworks_base_license"],
22}
23
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010024cc_defaults {
25 name: "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020026 tidy: true,
Stephen Hines328a29c2020-06-09 00:14:52 -070027 tidy_checks: [
28 "modernize-*",
29 "-modernize-avoid-c-arrays",
30 "-modernize-use-trailing-return-type",
31 "android-*",
32 "misc-*",
33 "readability-*",
34 ],
Stephen Hinesab170652020-06-09 00:13:57 -070035 tidy_checks_as_errors: [
Ryan Mitchell19823452019-01-29 12:01:24 -080036 "modernize-*",
37 "-modernize-avoid-c-arrays",
Yi Kongfbafa512019-07-27 14:43:50 -070038 "-modernize-use-trailing-return-type",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010039 "android-*",
40 "misc-*",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010041 "readability-*",
42 ],
Mårten Kongstad02751232018-04-27 13:16:32 +020043 tidy_flags: [
44 "-system-headers",
Mårten Kongstad02751232018-04-27 13:16:32 +020045 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010046}
47
48cc_library {
49 name: "libidmap2",
50 defaults: [
51 "idmap2_defaults",
52 ],
53 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020054 srcs: [
Winson62ac8b52019-12-04 08:36:48 -080055 "libidmap2/**/*.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020056 ],
57 export_include_dirs: ["include"],
58 target: {
59 android: {
60 static: {
61 enabled: false,
62 },
63 shared_libs: [
64 "libandroidfw",
65 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +010066 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020067 "libutils",
68 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -080069 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +020070 ],
71 },
72 host: {
73 shared: {
74 enabled: false,
75 },
76 static_libs: [
77 "libandroidfw",
78 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -070079 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020080 "libutils",
81 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -080082 "libidmap2_policies",
83 ],
84 },
85 },
86}
87
88cc_library {
89 name: "libidmap2_policies",
90 defaults: [
91 "idmap2_defaults",
92 ],
93 host_supported: true,
94 export_include_dirs: ["libidmap2_policies/include"],
95 target: {
96 windows: {
97 enabled: true,
98 },
99 android: {
100 static: {
101 enabled: false,
102 },
103 shared_libs: [
104 "libandroidfw",
105 ],
106 },
107 host: {
108 shared: {
109 enabled: false,
110 },
111 static_libs: [
112 "libandroidfw",
Mårten Kongstad02751232018-04-27 13:16:32 +0200113 ],
114 },
115 },
116}
117
118cc_test {
119 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100120 defaults: [
121 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200122 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100123 tidy_checks: [
124 "-readability-magic-numbers",
125 ],
126 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -0700127 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200128 srcs: [
129 "tests/BinaryStreamVisitorTests.cpp",
130 "tests/CommandLineOptionsTests.cpp",
131 "tests/FileUtilsTests.cpp",
132 "tests/Idmap2BinaryTests.cpp",
133 "tests/IdmapTests.cpp",
134 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -0800135 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200136 "tests/PrettyPrintVisitorTests.cpp",
137 "tests/RawPrintVisitorTests.cpp",
Ryan Mitchell9e4f52b2019-09-19 12:15:52 -0700138 "tests/ResourceMappingTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200139 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +0100140 "tests/ResultTests.cpp",
Ryan Mitchellcd965a32019-09-18 14:52:45 -0700141 "tests/XmlParserTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200142 "tests/ZipFileTests.cpp",
143 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200144 static_libs: ["libgmock"],
145 target: {
146 android: {
147 shared_libs: [
148 "libandroidfw",
149 "libbase",
150 "libidmap2",
151 "liblog",
152 "libutils",
153 "libz",
154 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800155 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200156 ],
157 },
158 host: {
159 static_libs: [
160 "libandroidfw",
161 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700162 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200163 "libidmap2",
164 "liblog",
165 "libutils",
166 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800167 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200168 ],
169 shared_libs: [
170 "libz",
171 ],
Julien Desprez91e03302021-02-08 16:46:08 -0800172 data: [
173 ":libz",
174 ":idmap2",
175 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200176 },
177 },
Julien Desprez91e03302021-02-08 16:46:08 -0800178 data: [
179 "tests/data/**/*.apk",
180 ],
181 compile_multilib: "first",
182 test_options: {
183 unit_test: true,
184 },
Mårten Kongstad02751232018-04-27 13:16:32 +0200185}
186
187cc_binary {
188 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100189 defaults: [
190 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200191 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100192 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200193 srcs: [
Ryan Mitchella7070132020-05-13 14:17:52 -0700194 "idmap2/CommandUtils.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200195 "idmap2/Create.cpp",
Ryan Mitchell9b939422020-02-04 10:18:53 -0800196 "idmap2/CreateMultiple.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200197 "idmap2/Dump.cpp",
198 "idmap2/Lookup.cpp",
199 "idmap2/Main.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200200 ],
201 target: {
202 android: {
203 shared_libs: [
204 "libandroidfw",
205 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100206 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200207 "libidmap2",
208 "libutils",
209 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800210 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200211 ],
212 },
213 host: {
214 static_libs: [
215 "libandroidfw",
216 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700217 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200218 "libidmap2",
219 "liblog",
220 "libutils",
221 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800222 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200223 ],
224 shared_libs: [
225 "libz",
226 ],
227 },
228 },
Winson62ac8b52019-12-04 08:36:48 -0800229
Mårten Kongstad02751232018-04-27 13:16:32 +0200230}
231
232cc_binary {
233 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100234 defaults: [
235 "idmap2_defaults",
236 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200237 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200238 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200239 "idmap2d/Idmap2Service.cpp",
240 "idmap2d/Main.cpp",
241 ],
242 shared_libs: [
243 "libandroidfw",
244 "libbase",
245 "libbinder",
246 "libcutils",
247 "libidmap2",
248 "libutils",
249 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800250 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200251 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100252 static_libs: [
253 "libidmap2daidl",
254 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200255 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200256}
257
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100258cc_library_static {
259 name: "libidmap2daidl",
260 defaults: [
261 "idmap2_defaults",
262 ],
263 tidy: false,
264 host_supported: false,
265 srcs: [
266 ":idmap2_aidl",
267 ],
268 shared_libs: [
269 "libbase",
270 ],
271 aidl: {
272 export_aidl_headers: true,
273 },
274}
275
Mårten Kongstad02751232018-04-27 13:16:32 +0200276filegroup {
277 name: "idmap2_aidl",
278 srcs: [
279 "idmap2d/aidl/android/os/IIdmap2.aidl",
280 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700281 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200282}
Winson62ac8b52019-12-04 08:36:48 -0800283
284aidl_interface {
285 name: "overlayable_policy_aidl",
Jiyong Parkdb589dd2020-04-13 12:55:24 +0900286 unstable: true,
Winson62ac8b52019-12-04 08:36:48 -0800287 srcs: [":overlayable_policy_aidl_files"],
288}
289
290filegroup {
291 name: "overlayable_policy_aidl_files",
292 srcs: [
293 "idmap2d/aidl/android/os/OverlayablePolicy.aidl",
294 ],
295 path: "idmap2d/aidl",
296}