blob: 41a17064c3ba85966211acdca5fb8705e09ac010 [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: [
39 "libidmap2/BinaryStreamVisitor.cpp",
40 "libidmap2/CommandLineOptions.cpp",
41 "libidmap2/FileUtils.cpp",
42 "libidmap2/Idmap.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080043 "libidmap2/Policies.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020044 "libidmap2/PrettyPrintVisitor.cpp",
45 "libidmap2/RawPrintVisitor.cpp",
Ryan Mitchell9e4f52b2019-09-19 12:15:52 -070046 "libidmap2/ResourceMapping.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020047 "libidmap2/ResourceUtils.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +010048 "libidmap2/Result.cpp",
Ryan Mitchellcd965a32019-09-18 14:52:45 -070049 "libidmap2/XmlParser.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020050 "libidmap2/ZipFile.cpp",
51 ],
52 export_include_dirs: ["include"],
53 target: {
54 android: {
55 static: {
56 enabled: false,
57 },
58 shared_libs: [
59 "libandroidfw",
60 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +010061 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020062 "libutils",
63 "libziparchive",
64 ],
65 },
66 host: {
67 shared: {
68 enabled: false,
69 },
70 static_libs: [
71 "libandroidfw",
72 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -070073 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020074 "libutils",
75 "libziparchive",
76 ],
77 },
78 },
79}
80
81cc_test {
82 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010083 defaults: [
84 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020085 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010086 tidy_checks: [
87 "-readability-magic-numbers",
88 ],
89 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -070090 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +020091 srcs: [
92 "tests/BinaryStreamVisitorTests.cpp",
93 "tests/CommandLineOptionsTests.cpp",
94 "tests/FileUtilsTests.cpp",
95 "tests/Idmap2BinaryTests.cpp",
96 "tests/IdmapTests.cpp",
97 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080098 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020099 "tests/PrettyPrintVisitorTests.cpp",
100 "tests/RawPrintVisitorTests.cpp",
Ryan Mitchell9e4f52b2019-09-19 12:15:52 -0700101 "tests/ResourceMappingTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200102 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +0100103 "tests/ResultTests.cpp",
Ryan Mitchellcd965a32019-09-18 14:52:45 -0700104 "tests/XmlParserTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200105 "tests/ZipFileTests.cpp",
106 ],
107 required: [
108 "idmap2",
109 ],
110 static_libs: ["libgmock"],
111 target: {
112 android: {
113 shared_libs: [
114 "libandroidfw",
115 "libbase",
116 "libidmap2",
117 "liblog",
118 "libutils",
119 "libz",
120 "libziparchive",
121 ],
122 },
123 host: {
124 static_libs: [
125 "libandroidfw",
126 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700127 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200128 "libidmap2",
129 "liblog",
130 "libutils",
131 "libziparchive",
132 ],
133 shared_libs: [
134 "libz",
135 ],
136 },
137 },
138 data: ["tests/data/**/*.apk"],
139}
140
141cc_binary {
142 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100143 defaults: [
144 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200145 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100146 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200147 srcs: [
148 "idmap2/Create.cpp",
149 "idmap2/Dump.cpp",
150 "idmap2/Lookup.cpp",
151 "idmap2/Main.cpp",
152 "idmap2/Scan.cpp",
153 "idmap2/Verify.cpp",
154 ],
155 target: {
156 android: {
157 shared_libs: [
158 "libandroidfw",
159 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100160 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200161 "libidmap2",
162 "libutils",
163 "libziparchive",
164 ],
165 },
166 host: {
167 static_libs: [
168 "libandroidfw",
169 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700170 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200171 "libidmap2",
172 "liblog",
173 "libutils",
174 "libziparchive",
175 ],
176 shared_libs: [
177 "libz",
178 ],
179 },
180 },
181}
182
183cc_binary {
184 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100185 defaults: [
186 "idmap2_defaults",
187 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200188 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200189 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200190 "idmap2d/Idmap2Service.cpp",
191 "idmap2d/Main.cpp",
192 ],
193 shared_libs: [
194 "libandroidfw",
195 "libbase",
196 "libbinder",
197 "libcutils",
198 "libidmap2",
199 "libutils",
200 "libziparchive",
201 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100202 static_libs: [
203 "libidmap2daidl",
204 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200205 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200206}
207
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100208cc_library_static {
209 name: "libidmap2daidl",
210 defaults: [
211 "idmap2_defaults",
212 ],
213 tidy: false,
214 host_supported: false,
215 srcs: [
216 ":idmap2_aidl",
217 ],
218 shared_libs: [
219 "libbase",
220 ],
221 aidl: {
222 export_aidl_headers: true,
223 },
224}
225
Mårten Kongstad02751232018-04-27 13:16:32 +0200226filegroup {
227 name: "idmap2_aidl",
228 srcs: [
229 "idmap2d/aidl/android/os/IIdmap2.aidl",
230 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700231 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200232}