blob: 60d64149510c6539bd24f42cfe1e008fc46513d9 [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",
46 "libidmap2/ResourceUtils.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +010047 "libidmap2/Result.cpp",
Ryan Mitchellcd965a32019-09-18 14:52:45 -070048 "libidmap2/XmlParser.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020049 "libidmap2/ZipFile.cpp",
50 ],
51 export_include_dirs: ["include"],
52 target: {
53 android: {
54 static: {
55 enabled: false,
56 },
57 shared_libs: [
58 "libandroidfw",
59 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +010060 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020061 "libutils",
62 "libziparchive",
63 ],
64 },
65 host: {
66 shared: {
67 enabled: false,
68 },
69 static_libs: [
70 "libandroidfw",
71 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -070072 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +020073 "libutils",
74 "libziparchive",
75 ],
76 },
77 },
78}
79
80cc_test {
81 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010082 defaults: [
83 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020084 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010085 tidy_checks: [
86 "-readability-magic-numbers",
87 ],
88 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -070089 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +020090 srcs: [
91 "tests/BinaryStreamVisitorTests.cpp",
92 "tests/CommandLineOptionsTests.cpp",
93 "tests/FileUtilsTests.cpp",
94 "tests/Idmap2BinaryTests.cpp",
95 "tests/IdmapTests.cpp",
96 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080097 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020098 "tests/PrettyPrintVisitorTests.cpp",
99 "tests/RawPrintVisitorTests.cpp",
100 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +0100101 "tests/ResultTests.cpp",
Ryan Mitchellcd965a32019-09-18 14:52:45 -0700102 "tests/XmlParserTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200103 "tests/ZipFileTests.cpp",
104 ],
105 required: [
106 "idmap2",
107 ],
108 static_libs: ["libgmock"],
109 target: {
110 android: {
111 shared_libs: [
112 "libandroidfw",
113 "libbase",
114 "libidmap2",
115 "liblog",
116 "libutils",
117 "libz",
118 "libziparchive",
119 ],
120 },
121 host: {
122 static_libs: [
123 "libandroidfw",
124 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700125 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200126 "libidmap2",
127 "liblog",
128 "libutils",
129 "libziparchive",
130 ],
131 shared_libs: [
132 "libz",
133 ],
134 },
135 },
136 data: ["tests/data/**/*.apk"],
137}
138
139cc_binary {
140 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100141 defaults: [
142 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200143 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100144 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200145 srcs: [
146 "idmap2/Create.cpp",
147 "idmap2/Dump.cpp",
148 "idmap2/Lookup.cpp",
149 "idmap2/Main.cpp",
150 "idmap2/Scan.cpp",
151 "idmap2/Verify.cpp",
152 ],
153 target: {
154 android: {
155 shared_libs: [
156 "libandroidfw",
157 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100158 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200159 "libidmap2",
160 "libutils",
161 "libziparchive",
162 ],
163 },
164 host: {
165 static_libs: [
166 "libandroidfw",
167 "libbase",
Steven Moreland598bda82019-09-18 12:58:11 -0700168 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200169 "libidmap2",
170 "liblog",
171 "libutils",
172 "libziparchive",
173 ],
174 shared_libs: [
175 "libz",
176 ],
177 },
178 },
179}
180
181cc_binary {
182 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100183 defaults: [
184 "idmap2_defaults",
185 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200186 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200187 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200188 "idmap2d/Idmap2Service.cpp",
189 "idmap2d/Main.cpp",
190 ],
191 shared_libs: [
192 "libandroidfw",
193 "libbase",
194 "libbinder",
195 "libcutils",
196 "libidmap2",
197 "libutils",
198 "libziparchive",
199 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100200 static_libs: [
201 "libidmap2daidl",
202 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200203 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200204}
205
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100206cc_library_static {
207 name: "libidmap2daidl",
208 defaults: [
209 "idmap2_defaults",
210 ],
211 tidy: false,
212 host_supported: false,
213 srcs: [
214 ":idmap2_aidl",
215 ],
216 shared_libs: [
217 "libbase",
218 ],
219 aidl: {
220 export_aidl_headers: true,
221 },
222}
223
Mårten Kongstad02751232018-04-27 13:16:32 +0200224filegroup {
225 name: "idmap2_aidl",
226 srcs: [
227 "idmap2d/aidl/android/os/IIdmap2.aidl",
228 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700229 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200230}