blob: 2fef407a8e3f527b4a39ae7b3a938e78cd6eb4aa [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",
59 "libutils",
60 "libziparchive",
61 ],
62 },
63 host: {
64 shared: {
65 enabled: false,
66 },
67 static_libs: [
68 "libandroidfw",
69 "libbase",
70 "libutils",
71 "libziparchive",
72 ],
73 },
74 },
75}
76
77cc_test {
78 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010079 defaults: [
80 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020081 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010082 tidy_checks: [
83 "-readability-magic-numbers",
84 ],
85 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020086 srcs: [
87 "tests/BinaryStreamVisitorTests.cpp",
88 "tests/CommandLineOptionsTests.cpp",
89 "tests/FileUtilsTests.cpp",
90 "tests/Idmap2BinaryTests.cpp",
91 "tests/IdmapTests.cpp",
92 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080093 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020094 "tests/PrettyPrintVisitorTests.cpp",
95 "tests/RawPrintVisitorTests.cpp",
96 "tests/ResourceUtilsTests.cpp",
Mårten Kongstad1e99b172019-01-28 08:49:12 +010097 "tests/ResultTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020098 "tests/XmlTests.cpp",
99 "tests/ZipFileTests.cpp",
100 ],
101 required: [
102 "idmap2",
103 ],
104 static_libs: ["libgmock"],
105 target: {
106 android: {
107 shared_libs: [
108 "libandroidfw",
109 "libbase",
110 "libidmap2",
111 "liblog",
112 "libutils",
113 "libz",
114 "libziparchive",
115 ],
116 },
117 host: {
118 static_libs: [
119 "libandroidfw",
120 "libbase",
121 "libidmap2",
122 "liblog",
123 "libutils",
124 "libziparchive",
125 ],
126 shared_libs: [
127 "libz",
128 ],
129 },
130 },
131 data: ["tests/data/**/*.apk"],
132}
133
134cc_binary {
135 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100136 defaults: [
137 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200138 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100139 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200140 srcs: [
141 "idmap2/Create.cpp",
142 "idmap2/Dump.cpp",
143 "idmap2/Lookup.cpp",
144 "idmap2/Main.cpp",
145 "idmap2/Scan.cpp",
146 "idmap2/Verify.cpp",
147 ],
148 target: {
149 android: {
150 shared_libs: [
151 "libandroidfw",
152 "libbase",
153 "libidmap2",
154 "libutils",
155 "libziparchive",
156 ],
157 },
158 host: {
159 static_libs: [
160 "libandroidfw",
161 "libbase",
162 "libidmap2",
163 "liblog",
164 "libutils",
165 "libziparchive",
166 ],
167 shared_libs: [
168 "libz",
169 ],
170 },
171 },
172}
173
174cc_binary {
175 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100176 defaults: [
177 "idmap2_defaults",
178 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200179 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200180 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200181 "idmap2d/Idmap2Service.cpp",
182 "idmap2d/Main.cpp",
183 ],
184 shared_libs: [
185 "libandroidfw",
186 "libbase",
187 "libbinder",
188 "libcutils",
189 "libidmap2",
190 "libutils",
191 "libziparchive",
192 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100193 static_libs: [
194 "libidmap2daidl",
195 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200196 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200197}
198
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100199cc_library_static {
200 name: "libidmap2daidl",
201 defaults: [
202 "idmap2_defaults",
203 ],
204 tidy: false,
205 host_supported: false,
206 srcs: [
207 ":idmap2_aidl",
208 ],
209 shared_libs: [
210 "libbase",
211 ],
212 aidl: {
213 export_aidl_headers: true,
214 },
215}
216
Mårten Kongstad02751232018-04-27 13:16:32 +0200217filegroup {
218 name: "idmap2_aidl",
219 srcs: [
220 "idmap2d/aidl/android/os/IIdmap2.aidl",
221 ],
222}