blob: 423bbd22fb58003847ba0a8cec2e4753ac7bf116 [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",
42 "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",
91 "tests/PrettyPrintVisitorTests.cpp",
92 "tests/RawPrintVisitorTests.cpp",
93 "tests/ResourceUtilsTests.cpp",
94 "tests/XmlTests.cpp",
95 "tests/ZipFileTests.cpp",
96 ],
97 required: [
98 "idmap2",
99 ],
100 static_libs: ["libgmock"],
101 target: {
102 android: {
103 shared_libs: [
104 "libandroidfw",
105 "libbase",
106 "libidmap2",
107 "liblog",
108 "libutils",
109 "libz",
110 "libziparchive",
111 ],
112 },
113 host: {
114 static_libs: [
115 "libandroidfw",
116 "libbase",
117 "libidmap2",
118 "liblog",
119 "libutils",
120 "libziparchive",
121 ],
122 shared_libs: [
123 "libz",
124 ],
125 },
126 },
127 data: ["tests/data/**/*.apk"],
128}
129
130cc_binary {
131 name: "idmap2",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100132 defaults: [
133 "idmap2_defaults",
Mårten Kongstad02751232018-04-27 13:16:32 +0200134 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100135 host_supported: true,
Mårten Kongstad02751232018-04-27 13:16:32 +0200136 srcs: [
137 "idmap2/Create.cpp",
138 "idmap2/Dump.cpp",
139 "idmap2/Lookup.cpp",
140 "idmap2/Main.cpp",
141 "idmap2/Scan.cpp",
142 "idmap2/Verify.cpp",
143 ],
144 target: {
145 android: {
146 shared_libs: [
147 "libandroidfw",
148 "libbase",
149 "libidmap2",
150 "libutils",
151 "libziparchive",
152 ],
153 },
154 host: {
155 static_libs: [
156 "libandroidfw",
157 "libbase",
158 "libidmap2",
159 "liblog",
160 "libutils",
161 "libziparchive",
162 ],
163 shared_libs: [
164 "libz",
165 ],
166 },
167 },
168}
169
170cc_binary {
171 name: "idmap2d",
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100172 defaults: [
173 "idmap2_defaults",
174 ],
Mårten Kongstad02751232018-04-27 13:16:32 +0200175 host_supported: false,
Mårten Kongstad02751232018-04-27 13:16:32 +0200176 srcs: [
Mårten Kongstad02751232018-04-27 13:16:32 +0200177 "idmap2d/Idmap2Service.cpp",
178 "idmap2d/Main.cpp",
179 ],
180 shared_libs: [
181 "libandroidfw",
182 "libbase",
183 "libbinder",
184 "libcutils",
185 "libidmap2",
186 "libutils",
187 "libziparchive",
188 ],
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100189 static_libs: [
190 "libidmap2daidl",
191 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200192 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200193}
194
Mårten Kongstad3c9bc612018-11-19 08:26:16 +0100195cc_library_static {
196 name: "libidmap2daidl",
197 defaults: [
198 "idmap2_defaults",
199 ],
200 tidy: false,
201 host_supported: false,
202 srcs: [
203 ":idmap2_aidl",
204 ],
205 shared_libs: [
206 "libbase",
207 ],
208 aidl: {
209 export_aidl_headers: true,
210 },
211}
212
Mårten Kongstad02751232018-04-27 13:16:32 +0200213filegroup {
214 name: "idmap2_aidl",
215 srcs: [
216 "idmap2d/aidl/android/os/IIdmap2.aidl",
217 ],
218}