blob: abe18ba8a415355644faa8c41b7dfabd0067ec44 [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",
Todd Kennedy044803f2018-12-21 15:10:16 -080026 "-warnings-as-errors=*",
Mårten Kongstad02751232018-04-27 13:16:32 +020027 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010028}
29
30cc_library {
31 name: "libidmap2",
32 defaults: [
33 "idmap2_defaults",
34 ],
35 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020036 srcs: [
37 "libidmap2/BinaryStreamVisitor.cpp",
38 "libidmap2/CommandLineOptions.cpp",
39 "libidmap2/FileUtils.cpp",
40 "libidmap2/Idmap.cpp",
41 "libidmap2/PrettyPrintVisitor.cpp",
42 "libidmap2/RawPrintVisitor.cpp",
43 "libidmap2/ResourceUtils.cpp",
44 "libidmap2/Xml.cpp",
45 "libidmap2/ZipFile.cpp",
46 ],
47 export_include_dirs: ["include"],
48 target: {
49 android: {
50 static: {
51 enabled: false,
52 },
53 shared_libs: [
54 "libandroidfw",
55 "libbase",
56 "libutils",
57 "libziparchive",
58 ],
59 },
60 host: {
61 shared: {
62 enabled: false,
63 },
64 static_libs: [
65 "libandroidfw",
66 "libbase",
67 "libutils",
68 "libziparchive",
69 ],
70 },
71 },
72}
73
74cc_test {
75 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010076 defaults: [
77 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020078 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010079 tidy_checks: [
80 "-readability-magic-numbers",
81 ],
82 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020083 srcs: [
84 "tests/BinaryStreamVisitorTests.cpp",
85 "tests/CommandLineOptionsTests.cpp",
86 "tests/FileUtilsTests.cpp",
87 "tests/Idmap2BinaryTests.cpp",
88 "tests/IdmapTests.cpp",
89 "tests/Main.cpp",
90 "tests/PrettyPrintVisitorTests.cpp",
91 "tests/RawPrintVisitorTests.cpp",
92 "tests/ResourceUtilsTests.cpp",
93 "tests/XmlTests.cpp",
94 "tests/ZipFileTests.cpp",
95 ],
96 required: [
97 "idmap2",
98 ],
99 static_libs: ["libgmock"],
100 target: {
101 android: {
102 shared_libs: [
103 "libandroidfw",
104 "libbase",
105 "libidmap2",
106 "liblog",
107 "libutils",
108 "libz",
109 "libziparchive",
110 ],
111 },
112 host: {
113 static_libs: [
114 "libandroidfw",
115 "libbase",
116 "libidmap2",
117 "liblog",
118 "libutils",
119 "libziparchive",
120 ],
121 shared_libs: [
122 "libz",
123 ],
124 },
125 },
126 data: ["tests/data/**/*.apk"],
127}
128
129cc_binary {
130 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100131 defaults: [
132 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200133 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100134 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200135 srcs: [
136 "idmap2/Create.cpp",
137 "idmap2/Dump.cpp",
138 "idmap2/Lookup.cpp",
139 "idmap2/Main.cpp",
140 "idmap2/Scan.cpp",
141 "idmap2/Verify.cpp",
142 ],
143 target: {
144 android: {
145 shared_libs: [
146 "libandroidfw",
147 "libbase",
148 "libidmap2",
149 "libutils",
150 "libziparchive",
151 ],
152 },
153 host: {
154 static_libs: [
155 "libandroidfw",
156 "libbase",
157 "libidmap2",
158 "liblog",
159 "libutils",
160 "libziparchive",
161 ],
162 shared_libs: [
163 "libz",
164 ],
165 },
166 },
167}
168
169cc_binary {
170 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100171 defaults: [
172 "idmap2_defaults",
173 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200174 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200175 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200176 "idmap2d/Idmap2Service.cpp",
177 "idmap2d/Main.cpp",
178 ],
179 shared_libs: [
180 "libandroidfw",
181 "libbase",
182 "libbinder",
183 "libcutils",
184 "libidmap2",
185 "libutils",
186 "libziparchive",
187 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100188 static_libs: [
189 "libidmap2daidl",
190 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200191 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200192}
193
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100194cc_library_static {
195 name: "libidmap2daidl",
196 defaults: [
197 "idmap2_defaults",
198 ],
199 tidy: false,
200 host_supported: false,
201 srcs: [
202 ":idmap2_aidl",
203 ],
204 shared_libs: [
205 "libbase",
206 ],
207 aidl: {
208 export_aidl_headers: true,
209 },
210}
211
Mårten Kongstad02751232018-04-27 13:16:32 +0200212filegroup {
213 name: "idmap2_aidl",
214 srcs: [
215 "idmap2d/aidl/android/os/IIdmap2.aidl",
216 ],
217}