blob: 4e57e884ee3e42b8bc5dc2db31c363fb4dc65b03 [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: [
46 "libidmap2/BinaryStreamVisitor.cpp",
47 "libidmap2/CommandLineOptions.cpp",
48 "libidmap2/FileUtils.cpp",
49 "libidmap2/Idmap.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080050 "libidmap2/Policies.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020051 "libidmap2/PrettyPrintVisitor.cpp",
52 "libidmap2/RawPrintVisitor.cpp",
53 "libidmap2/ResourceUtils.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +010054 "libidmap2/Result.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020055 "libidmap2/Xml.cpp",
56 "libidmap2/ZipFile.cpp",
57 ],
58 export_include_dirs: ["include"],
59 target: {
60 android: {
61 static: {
62 enabled: false,
63 },
64 shared_libs: [
65 "libandroidfw",
66 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +010067 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020068 "libutils",
69 "libziparchive",
70 ],
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",
82 ],
83 },
84 },
85}
86
87cc_test {
88 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010089 defaults: [
90 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020091 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010092 tidy_checks: [
93 "-readability-magic-numbers",
94 ],
95 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -070096 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +020097 srcs: [
98 "tests/BinaryStreamVisitorTests.cpp",
99 "tests/CommandLineOptionsTests.cpp",
100 "tests/FileUtilsTests.cpp",
101 "tests/Idmap2BinaryTests.cpp",
102 "tests/IdmapTests.cpp",
103 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -0800104 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200105 "tests/PrettyPrintVisitorTests.cpp",
106 "tests/RawPrintVisitorTests.cpp",
107 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +0100108 "tests/ResultTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200109 "tests/XmlTests.cpp",
110 "tests/ZipFileTests.cpp",
111 ],
112 required: [
113 "idmap2",
114 ],
115 static_libs: ["libgmock"],
116 target: {
117 android: {
118 shared_libs: [
119 "libandroidfw",
120 "libbase",
121 "libidmap2",
122 "liblog",
123 "libutils",
124 "libz",
125 "libziparchive",
126 ],
127 },
128 host: {
129 static_libs: [
130 "libandroidfw",
131 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700132 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200133 "libidmap2",
134 "liblog",
135 "libutils",
136 "libziparchive",
137 ],
138 shared_libs: [
139 "libz",
140 ],
141 },
142 },
143 data: ["tests/data/**/*.apk"],
144}
145
146cc_binary {
147 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100148 defaults: [
149 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200150 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100151 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200152 srcs: [
153 "idmap2/Create.cpp",
154 "idmap2/Dump.cpp",
155 "idmap2/Lookup.cpp",
156 "idmap2/Main.cpp",
157 "idmap2/Scan.cpp",
158 "idmap2/Verify.cpp",
159 ],
160 target: {
161 android: {
162 shared_libs: [
163 "libandroidfw",
164 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100165 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200166 "libidmap2",
167 "libutils",
168 "libziparchive",
169 ],
170 },
171 host: {
172 static_libs: [
173 "libandroidfw",
174 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700175 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200176 "libidmap2",
177 "liblog",
178 "libutils",
179 "libziparchive",
180 ],
181 shared_libs: [
182 "libz",
183 ],
184 },
185 },
186}
187
188cc_binary {
189 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100190 defaults: [
191 "idmap2_defaults",
192 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200193 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200194 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200195 "idmap2d/Idmap2Service.cpp",
196 "idmap2d/Main.cpp",
197 ],
198 shared_libs: [
199 "libandroidfw",
200 "libbase",
201 "libbinder",
202 "libcutils",
203 "libidmap2",
204 "libutils",
205 "libziparchive",
206 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100207 static_libs: [
208 "libidmap2daidl",
209 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200210 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200211}
212
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100213cc_library_static {
214 name: "libidmap2daidl",
215 defaults: [
216 "idmap2_defaults",
217 ],
218 tidy: false,
219 host_supported: false,
220 srcs: [
221 ":idmap2_aidl",
222 ],
223 shared_libs: [
224 "libbase",
225 ],
226 aidl: {
227 export_aidl_headers: true,
228 },
229}
230
Mårten Kongstad02751232018-04-27 13:16:32 +0200231filegroup {
232 name: "idmap2_aidl",
233 srcs: [
234 "idmap2d/aidl/android/os/IIdmap2.aidl",
235 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700236 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200237}