blob: 803f83c0bc6f0c25c1eefbcb1e6bb1c33c0b05fe [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-*",
Pirama Arumuga Nainar4b2d55b2019-01-17 12:12:49 -080023 "-modernize-avoid-c-arrays",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010024 ],
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",
46 "libidmap2/Xml.cpp",
47 "libidmap2/ZipFile.cpp",
48 ],
49 export_include_dirs: ["include"],
50 target: {
51 android: {
52 static: {
53 enabled: false,
54 },
55 shared_libs: [
56 "libandroidfw",
57 "libbase",
58 "libutils",
59 "libziparchive",
60 ],
61 },
62 host: {
63 shared: {
64 enabled: false,
65 },
66 static_libs: [
67 "libandroidfw",
68 "libbase",
69 "libutils",
70 "libziparchive",
71 ],
72 },
73 },
74}
75
76cc_test {
77 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010078 defaults: [
79 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020080 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010081 tidy_checks: [
82 "-readability-magic-numbers",
83 ],
84 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020085 srcs: [
86 "tests/BinaryStreamVisitorTests.cpp",
87 "tests/CommandLineOptionsTests.cpp",
88 "tests/FileUtilsTests.cpp",
89 "tests/Idmap2BinaryTests.cpp",
90 "tests/IdmapTests.cpp",
91 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080092 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020093 "tests/PrettyPrintVisitorTests.cpp",
94 "tests/RawPrintVisitorTests.cpp",
95 "tests/ResourceUtilsTests.cpp",
96 "tests/XmlTests.cpp",
97 "tests/ZipFileTests.cpp",
98 ],
99 required: [
100 "idmap2",
101 ],
102 static_libs: ["libgmock"],
103 target: {
104 android: {
105 shared_libs: [
106 "libandroidfw",
107 "libbase",
108 "libidmap2",
109 "liblog",
110 "libutils",
111 "libz",
112 "libziparchive",
113 ],
114 },
115 host: {
116 static_libs: [
117 "libandroidfw",
118 "libbase",
119 "libidmap2",
120 "liblog",
121 "libutils",
122 "libziparchive",
123 ],
124 shared_libs: [
125 "libz",
126 ],
127 },
128 },
129 data: ["tests/data/**/*.apk"],
130}
131
132cc_binary {
133 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100134 defaults: [
135 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200136 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100137 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200138 srcs: [
139 "idmap2/Create.cpp",
140 "idmap2/Dump.cpp",
141 "idmap2/Lookup.cpp",
142 "idmap2/Main.cpp",
143 "idmap2/Scan.cpp",
144 "idmap2/Verify.cpp",
145 ],
146 target: {
147 android: {
148 shared_libs: [
149 "libandroidfw",
150 "libbase",
151 "libidmap2",
152 "libutils",
153 "libziparchive",
154 ],
155 },
156 host: {
157 static_libs: [
158 "libandroidfw",
159 "libbase",
160 "libidmap2",
161 "liblog",
162 "libutils",
163 "libziparchive",
164 ],
165 shared_libs: [
166 "libz",
167 ],
168 },
169 },
170}
171
172cc_binary {
173 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100174 defaults: [
175 "idmap2_defaults",
176 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200177 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200178 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200179 "idmap2d/Idmap2Service.cpp",
180 "idmap2d/Main.cpp",
181 ],
182 shared_libs: [
183 "libandroidfw",
184 "libbase",
185 "libbinder",
186 "libcutils",
187 "libidmap2",
188 "libutils",
189 "libziparchive",
190 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100191 static_libs: [
192 "libidmap2daidl",
193 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200194 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200195}
196
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100197cc_library_static {
198 name: "libidmap2daidl",
199 defaults: [
200 "idmap2_defaults",
201 ],
202 tidy: false,
203 host_supported: false,
204 srcs: [
205 ":idmap2_aidl",
206 ],
207 shared_libs: [
208 "libbase",
209 ],
210 aidl: {
211 export_aidl_headers: true,
212 },
213}
214
Mårten Kongstad02751232018-04-27 13:16:32 +0200215filegroup {
216 name: "idmap2_aidl",
217 srcs: [
218 "idmap2d/aidl/android/os/IIdmap2.aidl",
219 ],
220}