blob: 771c0ef5260ace8c969fb23326323913c0972dd3 [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 Hinesab170652020-06-09 00:13:57 -070018 tidy_checks_as_errors: [
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",
Mårten Kongstad02751232018-04-27 13:16:32 +020028 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010029}
30
31cc_library {
32 name: "libidmap2",
33 defaults: [
34 "idmap2_defaults",
35 ],
36 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020037 srcs: [
38 "libidmap2/BinaryStreamVisitor.cpp",
39 "libidmap2/CommandLineOptions.cpp",
40 "libidmap2/FileUtils.cpp",
41 "libidmap2/Idmap.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080042 "libidmap2/Policies.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020043 "libidmap2/PrettyPrintVisitor.cpp",
44 "libidmap2/RawPrintVisitor.cpp",
45 "libidmap2/ResourceUtils.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +010046 "libidmap2/Result.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020047 "libidmap2/Xml.cpp",
48 "libidmap2/ZipFile.cpp",
49 ],
50 export_include_dirs: ["include"],
51 target: {
52 android: {
53 static: {
54 enabled: false,
55 },
56 shared_libs: [
57 "libandroidfw",
58 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +010059 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020060 "libutils",
61 "libziparchive",
62 ],
63 },
64 host: {
65 shared: {
66 enabled: false,
67 },
68 static_libs: [
69 "libandroidfw",
70 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -070071 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020072 "libutils",
73 "libziparchive",
74 ],
75 },
76 },
77}
78
79cc_test {
80 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010081 defaults: [
82 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020083 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010084 tidy_checks: [
85 "-readability-magic-numbers",
86 ],
87 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -070088 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +020089 srcs: [
90 "tests/BinaryStreamVisitorTests.cpp",
91 "tests/CommandLineOptionsTests.cpp",
92 "tests/FileUtilsTests.cpp",
93 "tests/Idmap2BinaryTests.cpp",
94 "tests/IdmapTests.cpp",
95 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080096 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020097 "tests/PrettyPrintVisitorTests.cpp",
98 "tests/RawPrintVisitorTests.cpp",
99 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +0100100 "tests/ResultTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200101 "tests/XmlTests.cpp",
102 "tests/ZipFileTests.cpp",
103 ],
104 required: [
105 "idmap2",
106 ],
107 static_libs: ["libgmock"],
108 target: {
109 android: {
110 shared_libs: [
111 "libandroidfw",
112 "libbase",
113 "libidmap2",
114 "liblog",
115 "libutils",
116 "libz",
117 "libziparchive",
118 ],
119 },
120 host: {
121 static_libs: [
122 "libandroidfw",
123 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700124 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200125 "libidmap2",
126 "liblog",
127 "libutils",
128 "libziparchive",
129 ],
130 shared_libs: [
131 "libz",
132 ],
133 },
134 },
135 data: ["tests/data/**/*.apk"],
136}
137
138cc_binary {
139 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100140 defaults: [
141 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200142 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100143 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200144 srcs: [
145 "idmap2/Create.cpp",
146 "idmap2/Dump.cpp",
147 "idmap2/Lookup.cpp",
148 "idmap2/Main.cpp",
149 "idmap2/Scan.cpp",
150 "idmap2/Verify.cpp",
151 ],
152 target: {
153 android: {
154 shared_libs: [
155 "libandroidfw",
156 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100157 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200158 "libidmap2",
159 "libutils",
160 "libziparchive",
161 ],
162 },
163 host: {
164 static_libs: [
165 "libandroidfw",
166 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700167 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200168 "libidmap2",
169 "liblog",
170 "libutils",
171 "libziparchive",
172 ],
173 shared_libs: [
174 "libz",
175 ],
176 },
177 },
178}
179
180cc_binary {
181 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100182 defaults: [
183 "idmap2_defaults",
184 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200185 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200186 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200187 "idmap2d/Idmap2Service.cpp",
188 "idmap2d/Main.cpp",
189 ],
190 shared_libs: [
191 "libandroidfw",
192 "libbase",
193 "libbinder",
194 "libcutils",
195 "libidmap2",
196 "libutils",
197 "libziparchive",
198 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100199 static_libs: [
200 "libidmap2daidl",
201 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200202 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200203}
204
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100205cc_library_static {
206 name: "libidmap2daidl",
207 defaults: [
208 "idmap2_defaults",
209 ],
210 tidy: false,
211 host_supported: false,
212 srcs: [
213 ":idmap2_aidl",
214 ],
215 shared_libs: [
216 "libbase",
217 ],
218 aidl: {
219 export_aidl_headers: true,
220 },
221}
222
Mårten Kongstad02751232018-04-27 13:16:32 +0200223filegroup {
224 name: "idmap2_aidl",
225 srcs: [
226 "idmap2d/aidl/android/os/IIdmap2.aidl",
227 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700228 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200229}