blob: d4d587108a549c7dc157fc49c2405c14d6f05c69 [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",
Mårten Kongstad02751232018-04-27 13:16:32 +020048 "libidmap2/Xml.cpp",
49 "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",
72 "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",
124 "libidmap2",
125 "liblog",
126 "libutils",
127 "libziparchive",
128 ],
129 shared_libs: [
130 "libz",
131 ],
132 },
133 },
134 data: ["tests/data/**/*.apk"],
135}
136
137cc_binary {
138 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100139 defaults: [
140 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200141 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100142 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200143 srcs: [
144 "idmap2/Create.cpp",
145 "idmap2/Dump.cpp",
146 "idmap2/Lookup.cpp",
147 "idmap2/Main.cpp",
148 "idmap2/Scan.cpp",
149 "idmap2/Verify.cpp",
150 ],
151 target: {
152 android: {
153 shared_libs: [
154 "libandroidfw",
155 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100156 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200157 "libidmap2",
158 "libutils",
159 "libziparchive",
160 ],
161 },
162 host: {
163 static_libs: [
164 "libandroidfw",
165 "libbase",
166 "libidmap2",
167 "liblog",
168 "libutils",
169 "libziparchive",
170 ],
171 shared_libs: [
172 "libz",
173 ],
174 },
175 },
176}
177
178cc_binary {
179 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100180 defaults: [
181 "idmap2_defaults",
182 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200183 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200184 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200185 "idmap2d/Idmap2Service.cpp",
186 "idmap2d/Main.cpp",
187 ],
188 shared_libs: [
189 "libandroidfw",
190 "libbase",
191 "libbinder",
192 "libcutils",
193 "libidmap2",
194 "libutils",
195 "libziparchive",
196 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100197 static_libs: [
198 "libidmap2daidl",
199 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200200 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200201}
202
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100203cc_library_static {
204 name: "libidmap2daidl",
205 defaults: [
206 "idmap2_defaults",
207 ],
208 tidy: false,
209 host_supported: false,
210 srcs: [
211 ":idmap2_aidl",
212 ],
213 shared_libs: [
214 "libbase",
215 ],
216 aidl: {
217 export_aidl_headers: true,
218 },
219}
220
Mårten Kongstad02751232018-04-27 13:16:32 +0200221filegroup {
222 name: "idmap2_aidl",
223 srcs: [
224 "idmap2d/aidl/android/os/IIdmap2.aidl",
225 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700226 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200227}