blob: d7922bc08ceadf8eb3a508d05c8557403921f2d0 [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
15cc_library {
16 name: "libidmap2",
17 host_supported: true,
18 tidy: true,
19 tidy_flags: [
20 "-system-headers",
Andreas Gamped3196be2018-11-26 09:46:39 -080021// b/120024673 "-warnings-as-errors=*",
Mårten Kongstad02751232018-04-27 13:16:32 +020022 ],
23 srcs: [
24 "libidmap2/BinaryStreamVisitor.cpp",
25 "libidmap2/CommandLineOptions.cpp",
26 "libidmap2/FileUtils.cpp",
27 "libidmap2/Idmap.cpp",
28 "libidmap2/PrettyPrintVisitor.cpp",
29 "libidmap2/RawPrintVisitor.cpp",
30 "libidmap2/ResourceUtils.cpp",
31 "libidmap2/Xml.cpp",
32 "libidmap2/ZipFile.cpp",
33 ],
34 export_include_dirs: ["include"],
35 target: {
36 android: {
37 static: {
38 enabled: false,
39 },
40 shared_libs: [
41 "libandroidfw",
42 "libbase",
43 "libutils",
44 "libziparchive",
45 ],
46 },
47 host: {
48 shared: {
49 enabled: false,
50 },
51 static_libs: [
52 "libandroidfw",
53 "libbase",
54 "libutils",
55 "libziparchive",
56 ],
57 },
58 },
59}
60
61cc_test {
62 name: "idmap2_tests",
63 host_supported: true,
64 tidy: true,
65 tidy_flags: [
66 "-system-headers",
Andreas Gamped3196be2018-11-26 09:46:39 -080067// b/120024673 "-warnings-as-errors=*",
Mårten Kongstad02751232018-04-27 13:16:32 +020068 ],
69 srcs: [
70 "tests/BinaryStreamVisitorTests.cpp",
71 "tests/CommandLineOptionsTests.cpp",
72 "tests/FileUtilsTests.cpp",
73 "tests/Idmap2BinaryTests.cpp",
74 "tests/IdmapTests.cpp",
75 "tests/Main.cpp",
76 "tests/PrettyPrintVisitorTests.cpp",
77 "tests/RawPrintVisitorTests.cpp",
78 "tests/ResourceUtilsTests.cpp",
79 "tests/XmlTests.cpp",
80 "tests/ZipFileTests.cpp",
81 ],
82 required: [
83 "idmap2",
84 ],
85 static_libs: ["libgmock"],
86 target: {
87 android: {
88 shared_libs: [
89 "libandroidfw",
90 "libbase",
91 "libidmap2",
92 "liblog",
93 "libutils",
94 "libz",
95 "libziparchive",
96 ],
97 },
98 host: {
99 static_libs: [
100 "libandroidfw",
101 "libbase",
102 "libidmap2",
103 "liblog",
104 "libutils",
105 "libziparchive",
106 ],
107 shared_libs: [
108 "libz",
109 ],
110 },
111 },
112 data: ["tests/data/**/*.apk"],
113}
114
115cc_binary {
116 name: "idmap2",
117 host_supported: true,
118 tidy: true,
119 tidy_flags: [
120 "-system-headers",
Andreas Gamped3196be2018-11-26 09:46:39 -0800121// b/120024673 "-warnings-as-errors=*",
Mårten Kongstad02751232018-04-27 13:16:32 +0200122 ],
123 srcs: [
124 "idmap2/Create.cpp",
125 "idmap2/Dump.cpp",
126 "idmap2/Lookup.cpp",
127 "idmap2/Main.cpp",
128 "idmap2/Scan.cpp",
129 "idmap2/Verify.cpp",
130 ],
131 target: {
132 android: {
133 shared_libs: [
134 "libandroidfw",
135 "libbase",
136 "libidmap2",
137 "libutils",
138 "libziparchive",
139 ],
140 },
141 host: {
142 static_libs: [
143 "libandroidfw",
144 "libbase",
145 "libidmap2",
146 "liblog",
147 "libutils",
148 "libziparchive",
149 ],
150 shared_libs: [
151 "libz",
152 ],
153 },
154 },
155}
156
157cc_binary {
158 name: "idmap2d",
159 host_supported: false,
160 tidy: true,
161 tidy_checks: [
162 // remove google-default-arguments or clang-tidy will complain about
163 // the auto-generated file IIdmap2.cpp
164 "-google-default-arguments",
165 ],
166 tidy_flags: [
167 "-system-headers",
Andreas Gamped3196be2018-11-26 09:46:39 -0800168// b/120024673 "-warnings-as-errors=*",
Mårten Kongstad02751232018-04-27 13:16:32 +0200169 ],
170 srcs: [
171 ":idmap2_aidl",
172 "idmap2d/Idmap2Service.cpp",
173 "idmap2d/Main.cpp",
174 ],
175 shared_libs: [
176 "libandroidfw",
177 "libbase",
178 "libbinder",
179 "libcutils",
180 "libidmap2",
181 "libutils",
182 "libziparchive",
183 ],
Mårten Kongstadb87b50722018-09-21 09:58:10 +0200184 init_rc: ["idmap2d/idmap2d.rc"],
Mårten Kongstad02751232018-04-27 13:16:32 +0200185}
186
187filegroup {
188 name: "idmap2_aidl",
189 srcs: [
190 "idmap2d/aidl/android/os/IIdmap2.aidl",
191 ],
192}