blob: e9cfe63e0d03a6b7405ed65e1796e151303330d7 [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",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080041 "libidmap2/Policies.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020042 "libidmap2/PrettyPrintVisitor.cpp",
43 "libidmap2/RawPrintVisitor.cpp",
44 "libidmap2/ResourceUtils.cpp",
45 "libidmap2/Xml.cpp",
46 "libidmap2/ZipFile.cpp",
47 ],
48 export_include_dirs: ["include"],
49 target: {
50 android: {
51 static: {
52 enabled: false,
53 },
54 shared_libs: [
55 "libandroidfw",
56 "libbase",
57 "libutils",
58 "libziparchive",
59 ],
60 },
61 host: {
62 shared: {
63 enabled: false,
64 },
65 static_libs: [
66 "libandroidfw",
67 "libbase",
68 "libutils",
69 "libziparchive",
70 ],
71 },
72 },
73}
74
75cc_test {
76 name: "idmap2_tests",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010077 defaults: [
78 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +020079 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +010080 tidy_checks: [
81 "-readability-magic-numbers",
82 ],
83 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +020084 srcs: [
85 "tests/BinaryStreamVisitorTests.cpp",
86 "tests/CommandLineOptionsTests.cpp",
87 "tests/FileUtilsTests.cpp",
88 "tests/Idmap2BinaryTests.cpp",
89 "tests/IdmapTests.cpp",
90 "tests/Main.cpp",
Mårten Kongstadd10d06d2019-01-07 17:26:25 -080091 "tests/PoliciesTests.cpp",
Mårten Kongstad02751232018-04-27 13:16:32 +020092 "tests/PrettyPrintVisitorTests.cpp",
93 "tests/RawPrintVisitorTests.cpp",
94 "tests/ResourceUtilsTests.cpp",
95 "tests/XmlTests.cpp",
96 "tests/ZipFileTests.cpp",
97 ],
98 required: [
99 "idmap2",
100 ],
101 static_libs: ["libgmock"],
102 target: {
103 android: {
104 shared_libs: [
105 "libandroidfw",
106 "libbase",
107 "libidmap2",
108 "liblog",
109 "libutils",
110 "libz",
111 "libziparchive",
112 ],
113 },
114 host: {
115 static_libs: [
116 "libandroidfw",
117 "libbase",
118 "libidmap2",
119 "liblog",
120 "libutils",
121 "libziparchive",
122 ],
123 shared_libs: [
124 "libz",
125 ],
126 },
127 },
128 data: ["tests/data/**/*.apk"],
129}
130
131cc_binary {
132 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100133 defaults: [
134 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200135 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100136 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200137 srcs: [
138 "idmap2/Create.cpp",
139 "idmap2/Dump.cpp",
140 "idmap2/Lookup.cpp",
141 "idmap2/Main.cpp",
142 "idmap2/Scan.cpp",
143 "idmap2/Verify.cpp",
144 ],
145 target: {
146 android: {
147 shared_libs: [
148 "libandroidfw",
149 "libbase",
150 "libidmap2",
151 "libutils",
152 "libziparchive",
153 ],
154 },
155 host: {
156 static_libs: [
157 "libandroidfw",
158 "libbase",
159 "libidmap2",
160 "liblog",
161 "libutils",
162 "libziparchive",
163 ],
164 shared_libs: [
165 "libz",
166 ],
167 },
168 },
169}
170
171cc_binary {
172 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100173 defaults: [
174 "idmap2_defaults",
175 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200176 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200177 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200178 "idmap2d/Idmap2Service.cpp",
179 "idmap2d/Main.cpp",
180 ],
181 shared_libs: [
182 "libandroidfw",
183 "libbase",
184 "libbinder",
185 "libcutils",
186 "libidmap2",
187 "libutils",
188 "libziparchive",
189 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100190 static_libs: [
191 "libidmap2daidl",
192 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200193 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200194}
195
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100196cc_library_static {
197 name: "libidmap2daidl",
198 defaults: [
199 "idmap2_defaults",
200 ],
201 tidy: false,
202 host_supported: false,
203 srcs: [
204 ":idmap2_aidl",
205 ],
206 shared_libs: [
207 "libbase",
208 ],
209 aidl: {
210 export_aidl_headers: true,
211 },
212}
213
Mårten Kongstad02751232018-04-27 13:16:32 +0200214filegroup {
215 name: "idmap2_aidl",
216 srcs: [
217 "idmap2d/aidl/android/os/IIdmap2.aidl",
218 ],
219}