blob: d757e4611158a2d487c758e1a33fc3dcfeb7a28c [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,
Mårten Kongstad02751232018-04-27 13:16:32 +020087 srcs: [
88 "tests/BinaryStreamVisitorTests.cpp",
89 "tests/CommandLineOptionsTests.cpp",
90 "tests/FileUtilsTests.cpp",
91 "tests/Idmap2BinaryTests.cpp",
92 "tests/IdmapTests.cpp",
93 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080094 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020095 "tests/PrettyPrintVisitorTests.cpp",
96 "tests/RawPrintVisitorTests.cpp",
97 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +010098 "tests/ResultTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020099 "tests/XmlTests.cpp",
100 "tests/ZipFileTests.cpp",
101 ],
102 required: [
103 "idmap2",
104 ],
105 static_libs: ["libgmock"],
106 target: {
107 android: {
108 shared_libs: [
109 "libandroidfw",
110 "libbase",
111 "libidmap2",
112 "liblog",
113 "libutils",
114 "libz",
115 "libziparchive",
116 ],
117 },
118 host: {
119 static_libs: [
120 "libandroidfw",
121 "libbase",
122 "libidmap2",
123 "liblog",
124 "libutils",
125 "libziparchive",
126 ],
127 shared_libs: [
128 "libz",
129 ],
130 },
131 },
132 data: ["tests/data/**/*.apk"],
133}
134
135cc_binary {
136 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100137 defaults: [
138 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200139 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100140 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200141 srcs: [
142 "idmap2/Create.cpp",
143 "idmap2/Dump.cpp",
144 "idmap2/Lookup.cpp",
145 "idmap2/Main.cpp",
146 "idmap2/Scan.cpp",
147 "idmap2/Verify.cpp",
148 ],
149 target: {
150 android: {
151 shared_libs: [
152 "libandroidfw",
153 "libbase",
Mårten Kongstad4cbb0072018-11-30 16:22:05 +0100154 "libcutils",
Mårten Kongstad02751232018-04-27 13:16:32 +0200155 "libidmap2",
156 "libutils",
157 "libziparchive",
158 ],
159 },
160 host: {
161 static_libs: [
162 "libandroidfw",
163 "libbase",
164 "libidmap2",
165 "liblog",
166 "libutils",
167 "libziparchive",
168 ],
169 shared_libs: [
170 "libz",
171 ],
172 },
173 },
174}
175
176cc_binary {
177 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100178 defaults: [
179 "idmap2_defaults",
180 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200181 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200182 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200183 "idmap2d/Idmap2Service.cpp",
184 "idmap2d/Main.cpp",
185 ],
186 shared_libs: [
187 "libandroidfw",
188 "libbase",
189 "libbinder",
190 "libcutils",
191 "libidmap2",
192 "libutils",
193 "libziparchive",
194 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100195 static_libs: [
196 "libidmap2daidl",
197 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200198 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200199}
200
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100201cc_library_static {
202 name: "libidmap2daidl",
203 defaults: [
204 "idmap2_defaults",
205 ],
206 tidy: false,
207 host_supported: false,
208 srcs: [
209 ":idmap2_aidl",
210 ],
211 shared_libs: [
212 "libbase",
213 ],
214 aidl: {
215 export_aidl_headers: true,
216 },
217}
218
Mårten Kongstad02751232018-04-27 13:16:32 +0200219filegroup {
220 name: "idmap2_aidl",
221 srcs: [
222 "idmap2d/aidl/android/os/IIdmap2.aidl",
223 ],
224}