blob: 66f5c3908e4bbc83a049dd17548e05a38a874316 [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",
Ryan Mitchell9b939422020-02-04 10:18:53 -0800149 "idmap2/CreateMultiple.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200150 "idmap2/Dump.cpp",
151 "idmap2/Lookup.cpp",
152 "idmap2/Main.cpp",
153 "idmap2/Scan.cpp",
154 "idmap2/Verify.cpp",
155 ],
156 target: {
157 android: {
158 shared_libs: [
159 "libandroidfw",
160 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100161 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200162 "libidmap2",
163 "libutils",
164 "libziparchive",
165 ],
166 },
167 host: {
168 static_libs: [
169 "libandroidfw",
170 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700171 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200172 "libidmap2",
173 "liblog",
174 "libutils",
175 "libziparchive",
176 ],
177 shared_libs: [
178 "libz",
179 ],
180 },
181 },
182}
183
184cc_binary {
185 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100186 defaults: [
187 "idmap2_defaults",
188 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200189 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200190 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200191 "idmap2d/Idmap2Service.cpp",
192 "idmap2d/Main.cpp",
193 ],
194 shared_libs: [
195 "libandroidfw",
196 "libbase",
197 "libbinder",
198 "libcutils",
199 "libidmap2",
200 "libutils",
201 "libziparchive",
202 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100203 static_libs: [
204 "libidmap2daidl",
205 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200206 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200207}
208
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100209cc_library_static {
210 name: "libidmap2daidl",
211 defaults: [
212 "idmap2_defaults",
213 ],
214 tidy: false,
215 host_supported: false,
216 srcs: [
217 ":idmap2_aidl",
218 ],
219 shared_libs: [
220 "libbase",
221 ],
222 aidl: {
223 export_aidl_headers: true,
224 },
225}
226
Mårten Kongstad02751232018-04-27 13:16:32 +0200227filegroup {
228 name: "idmap2_aidl",
229 srcs: [
230 "idmap2d/aidl/android/os/IIdmap2.aidl",
231 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700232 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200233}