blob: fe7099b2f3eac841a524c52182f425ac024bf069 [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: [
19 "android-*",
20 "misc-*",
21 "modernize-*",
22 "readability-*",
23 ],
Mårten Kongstad02751232018-04-27 13:16:32 +020024 tidy_flags: [
25 "-system-headers",
Mårten Kongstad02751232018-04-27 13:16:32 +020026 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010027}
28
29cc_library {
30 name: "libidmap2",
31 defaults: [
32 "idmap2_defaults",
33 ],
34 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020035 srcs: [
36 "libidmap2/BinaryStreamVisitor.cpp",
37 "libidmap2/CommandLineOptions.cpp",
38 "libidmap2/FileUtils.cpp",
39 "libidmap2/Idmap.cpp",
40 "libidmap2/PrettyPrintVisitor.cpp",
41 "libidmap2/RawPrintVisitor.cpp",
42 "libidmap2/ResourceUtils.cpp",
43 "libidmap2/Xml.cpp",
44 "libidmap2/ZipFile.cpp",
45 ],
46 export_include_dirs: ["include"],
47 target: {
48 android: {
49 static: {
50 enabled: false,
51 },
52 shared_libs: [
53 "libandroidfw",
54 "libbase",
55 "libutils",
56 "libziparchive",
57 ],
58 },
59 host: {
60 shared: {
61 enabled: false,
62 },
63 static_libs: [
64 "libandroidfw",
65 "libbase",
66 "libutils",
67 "libziparchive",
68 ],
69 },
70 },
71}
72
73cc_test {
74 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010075 defaults: [
76 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020077 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010078 tidy_checks: [
79 "-readability-magic-numbers",
80 ],
81 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020082 srcs: [
83 "tests/BinaryStreamVisitorTests.cpp",
84 "tests/CommandLineOptionsTests.cpp",
85 "tests/FileUtilsTests.cpp",
86 "tests/Idmap2BinaryTests.cpp",
87 "tests/IdmapTests.cpp",
88 "tests/Main.cpp",
89 "tests/PrettyPrintVisitorTests.cpp",
90 "tests/RawPrintVisitorTests.cpp",
91 "tests/ResourceUtilsTests.cpp",
92 "tests/XmlTests.cpp",
93 "tests/ZipFileTests.cpp",
94 ],
95 required: [
96 "idmap2",
97 ],
98 static_libs: ["libgmock"],
99 target: {
100 android: {
101 shared_libs: [
102 "libandroidfw",
103 "libbase",
104 "libidmap2",
105 "liblog",
106 "libutils",
107 "libz",
108 "libziparchive",
109 ],
110 },
111 host: {
112 static_libs: [
113 "libandroidfw",
114 "libbase",
115 "libidmap2",
116 "liblog",
117 "libutils",
118 "libziparchive",
119 ],
120 shared_libs: [
121 "libz",
122 ],
123 },
124 },
125 data: ["tests/data/**/*.apk"],
126}
127
128cc_binary {
129 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100130 defaults: [
131 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200132 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100133 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200134 srcs: [
135 "idmap2/Create.cpp",
136 "idmap2/Dump.cpp",
137 "idmap2/Lookup.cpp",
138 "idmap2/Main.cpp",
139 "idmap2/Scan.cpp",
140 "idmap2/Verify.cpp",
141 ],
142 target: {
143 android: {
144 shared_libs: [
145 "libandroidfw",
146 "libbase",
147 "libidmap2",
148 "libutils",
149 "libziparchive",
150 ],
151 },
152 host: {
153 static_libs: [
154 "libandroidfw",
155 "libbase",
156 "libidmap2",
157 "liblog",
158 "libutils",
159 "libziparchive",
160 ],
161 shared_libs: [
162 "libz",
163 ],
164 },
165 },
166}
167
168cc_binary {
169 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100170 defaults: [
171 "idmap2_defaults",
172 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200173 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200174 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200175 "idmap2d/Idmap2Service.cpp",
176 "idmap2d/Main.cpp",
177 ],
178 shared_libs: [
179 "libandroidfw",
180 "libbase",
181 "libbinder",
182 "libcutils",
183 "libidmap2",
184 "libutils",
185 "libziparchive",
186 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100187 static_libs: [
188 "libidmap2daidl",
189 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200190 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200191}
192
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100193cc_library_static {
194 name: "libidmap2daidl",
195 defaults: [
196 "idmap2_defaults",
197 ],
198 tidy: false,
199 host_supported: false,
200 srcs: [
201 ":idmap2_aidl",
202 ],
203 shared_libs: [
204 "libbase",
205 ],
206 aidl: {
207 export_aidl_headers: true,
208 },
209}
210
Mårten Kongstad02751232018-04-27 13:16:32 +0200211filegroup {
212 name: "idmap2_aidl",
213 srcs: [
214 "idmap2d/aidl/android/os/IIdmap2.aidl",
215 ],
216}