blob: 3bb99298debf78f97df6da1da6be101132ee7f1c [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",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010021 "android-*",
22 "misc-*",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010023 "readability-*",
24 ],
Mårten Kongstad02751232018-04-27 13:16:32 +020025 tidy_flags: [
26 "-system-headers",
Todd Kennedy044803f2018-12-21 15:10:16 -080027 "-warnings-as-errors=*",
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",
71 "libutils",
72 "libziparchive",
73 ],
74 },
75 },
76}
77
78cc_test {
79 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010080 defaults: [
81 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020082 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010083 tidy_checks: [
84 "-readability-magic-numbers",
85 ],
86 host_supported: true,
Ryan Mitchellbcc179a2019-03-29 14:55:51 -070087 test_suites: ["general-tests"],
Mårten Kongstad02751232018-04-27 13:16:32 +020088 srcs: [
89 "tests/BinaryStreamVisitorTests.cpp",
90 "tests/CommandLineOptionsTests.cpp",
91 "tests/FileUtilsTests.cpp",
92 "tests/Idmap2BinaryTests.cpp",
93 "tests/IdmapTests.cpp",
94 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080095 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020096 "tests/PrettyPrintVisitorTests.cpp",
97 "tests/RawPrintVisitorTests.cpp",
98 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +010099 "tests/ResultTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +0200100 "tests/XmlTests.cpp",
101 "tests/ZipFileTests.cpp",
102 ],
103 required: [
104 "idmap2",
105 ],
106 static_libs: ["libgmock"],
107 target: {
108 android: {
109 shared_libs: [
110 "libandroidfw",
111 "libbase",
112 "libidmap2",
113 "liblog",
114 "libutils",
115 "libz",
116 "libziparchive",
117 ],
118 },
119 host: {
120 static_libs: [
121 "libandroidfw",
122 "libbase",
123 "libidmap2",
124 "liblog",
125 "libutils",
126 "libziparchive",
127 ],
128 shared_libs: [
129 "libz",
130 ],
131 },
132 },
133 data: ["tests/data/**/*.apk"],
134}
135
136cc_binary {
137 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100138 defaults: [
139 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200140 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100141 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200142 srcs: [
143 "idmap2/Create.cpp",
144 "idmap2/Dump.cpp",
145 "idmap2/Lookup.cpp",
146 "idmap2/Main.cpp",
147 "idmap2/Scan.cpp",
148 "idmap2/Verify.cpp",
149 ],
150 target: {
151 android: {
152 shared_libs: [
153 "libandroidfw",
154 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100155 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200156 "libidmap2",
157 "libutils",
158 "libziparchive",
159 ],
160 },
161 host: {
162 static_libs: [
163 "libandroidfw",
164 "libbase",
165 "libidmap2",
166 "liblog",
167 "libutils",
168 "libziparchive",
169 ],
170 shared_libs: [
171 "libz",
172 ],
173 },
174 },
175}
176
177cc_binary {
178 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100179 defaults: [
180 "idmap2_defaults",
181 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200182 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200183 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200184 "idmap2d/Idmap2Service.cpp",
185 "idmap2d/Main.cpp",
186 ],
187 shared_libs: [
188 "libandroidfw",
189 "libbase",
190 "libbinder",
191 "libcutils",
192 "libidmap2",
193 "libutils",
194 "libziparchive",
195 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100196 static_libs: [
197 "libidmap2daidl",
198 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200199 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200200}
201
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100202cc_library_static {
203 name: "libidmap2daidl",
204 defaults: [
205 "idmap2_defaults",
206 ],
207 tidy: false,
208 host_supported: false,
209 srcs: [
210 ":idmap2_aidl",
211 ],
212 shared_libs: [
213 "libbase",
214 ],
215 aidl: {
216 export_aidl_headers: true,
217 },
218}
219
Mårten Kongstad02751232018-04-27 13:16:32 +0200220filegroup {
221 name: "idmap2_aidl",
222 srcs: [
223 "idmap2d/aidl/android/os/IIdmap2.aidl",
224 ],
Dan Willemsend1a5aa62019-06-08 08:42:07 -0700225 path: "idmap2d/aidl",
Mårten Kongstad02751232018-04-27 13:16:32 +0200226}