blob: 645dc935fc07b70c9479ae572c89d4a862886ab5 [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,
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010018 tidy_checks: [
Ryan Mitchell19823452019-01-29 12:01:24 -080019 "modernize-*",
20 "-modernize-avoid-c-arrays",
Yi Kongfbafa512019-07-27 14:43:50 -070021 "-modernize-use-trailing-return-type",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010022 "android-*",
23 "misc-*",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010024 "readability-*",
25 ],
Mårten Kongstad02751232018-04-27 13:16:32 +020026 tidy_flags: [
27 "-system-headers",
Todd Kennedy044803f2018-12-21 15:10:16 -080028 "-warnings-as-errors=*",
Mårten Kongstad02751232018-04-27 13:16:32 +020029 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010030}
31
32cc_library {
33 name: "libidmap2",
34 defaults: [
35 "idmap2_defaults",
36 ],
37 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020038 srcs: [
Winson62ac8b52019-12-04 08:36:48 -080039 "libidmap2/**/*.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020040 ],
41 export_include_dirs: ["include"],
42 target: {
43 android: {
44 static: {
45 enabled: false,
46 },
47 shared_libs: [
48 "libandroidfw",
49 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +010050 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020051 "libutils",
52 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -080053 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +020054 ],
55 },
56 host: {
57 shared: {
58 enabled: false,
59 },
60 static_libs: [
61 "libandroidfw",
62 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -070063 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020064 "libutils",
65 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -080066 "libidmap2_policies",
67 ],
68 },
69 },
70}
71
72cc_library {
73 name: "libidmap2_policies",
74 defaults: [
75 "idmap2_defaults",
76 ],
77 host_supported: true,
78 export_include_dirs: ["libidmap2_policies/include"],
79 target: {
80 windows: {
81 enabled: true,
82 },
83 android: {
84 static: {
85 enabled: false,
86 },
87 shared_libs: [
88 "libandroidfw",
89 ],
90 },
91 host: {
92 shared: {
93 enabled: false,
94 },
95 static_libs: [
96 "libandroidfw",
Mårten Kongstad02751232018-04-27 13:16:32 +020097 ],
98 },
99 },
100}
101
102cc_test {
103 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100104 defaults: [
105 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200106 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100107 tidy_checks: [
108 "-readability-magic-numbers",
109 ],
110 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -0700111 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200112 srcs: [
113 "tests/BinaryStreamVisitorTests.cpp",
114 "tests/CommandLineOptionsTests.cpp",
115 "tests/FileUtilsTests.cpp",
116 "tests/Idmap2BinaryTests.cpp",
117 "tests/IdmapTests.cpp",
118 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -0800119 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200120 "tests/PrettyPrintVisitorTests.cpp",
121 "tests/RawPrintVisitorTests.cpp",
Ryan Mitchell9e4f52b2019-09-19 12:15:52 -0700122 "tests/ResourceMappingTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200123 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +0100124 "tests/ResultTests.cpp",
Ryan Mitchellcd965a32019-09-18 14:52:45 -0700125 "tests/XmlParserTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200126 "tests/ZipFileTests.cpp",
127 ],
128 required: [
129 "idmap2",
130 ],
131 static_libs: ["libgmock"],
132 target: {
133 android: {
134 shared_libs: [
135 "libandroidfw",
136 "libbase",
137 "libidmap2",
138 "liblog",
139 "libutils",
140 "libz",
141 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800142 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200143 ],
144 },
145 host: {
146 static_libs: [
147 "libandroidfw",
148 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700149 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200150 "libidmap2",
151 "liblog",
152 "libutils",
153 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800154 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200155 ],
156 shared_libs: [
157 "libz",
158 ],
159 },
160 },
161 data: ["tests/data/**/*.apk"],
162}
163
164cc_binary {
165 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100166 defaults: [
167 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200168 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100169 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200170 srcs: [
171 "idmap2/Create.cpp",
Ryan Mitchell9b939422020-02-04 10:18:53 -0800172 "idmap2/CreateMultiple.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200173 "idmap2/Dump.cpp",
174 "idmap2/Lookup.cpp",
175 "idmap2/Main.cpp",
176 "idmap2/Scan.cpp",
177 "idmap2/Verify.cpp",
178 ],
179 target: {
180 android: {
181 shared_libs: [
182 "libandroidfw",
183 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100184 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200185 "libidmap2",
186 "libutils",
187 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800188 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200189 ],
190 },
191 host: {
192 static_libs: [
193 "libandroidfw",
194 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700195 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200196 "libidmap2",
197 "liblog",
198 "libutils",
199 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800200 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200201 ],
202 shared_libs: [
203 "libz",
204 ],
205 },
206 },
Winson62ac8b52019-12-04 08:36:48 -0800207
Mårten Kongstad02751232018-04-27 13:16:32 +0200208}
209
210cc_binary {
211 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100212 defaults: [
213 "idmap2_defaults",
214 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200215 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200216 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200217 "idmap2d/Idmap2Service.cpp",
218 "idmap2d/Main.cpp",
219 ],
220 shared_libs: [
221 "libandroidfw",
222 "libbase",
223 "libbinder",
224 "libcutils",
225 "libidmap2",
226 "libutils",
227 "libziparchive",
Winson62ac8b52019-12-04 08:36:48 -0800228 "libidmap2_policies",
Mårten Kongstad02751232018-04-27 13:16:32 +0200229 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100230 static_libs: [
231 "libidmap2daidl",
232 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200233 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200234}
235
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100236cc_library_static {
237 name: "libidmap2daidl",
238 defaults: [
239 "idmap2_defaults",
240 ],
241 tidy: false,
242 host_supported: false,
243 srcs: [
244 ":idmap2_aidl",
245 ],
246 shared_libs: [
247 "libbase",
248 ],
249 aidl: {
250 export_aidl_headers: true,
251 },
252}
253
Mårten Kongstad02751232018-04-27 13:16:32 +0200254filegroup {
255 name: "idmap2_aidl",
256 srcs: [
257 "idmap2d/aidl/android/os/IIdmap2.aidl",
258 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700259 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200260}
Winson62ac8b52019-12-04 08:36:48 -0800261
262aidl_interface {
263 name: "overlayable_policy_aidl",
264 srcs: [":overlayable_policy_aidl_files"],
265}
266
267filegroup {
268 name: "overlayable_policy_aidl_files",
269 srcs: [
270 "idmap2d/aidl/android/os/OverlayablePolicy.aidl",
271 ],
272 path: "idmap2d/aidl",
273}