blob: cfa438d0ed761e2762227f94e72b7a1ad09e7c09 [file] [log] [blame]
Dan Willemsen8fd503f2016-10-04 20:04:36 -07001//
2// Copyright (C) 2015 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17cc_defaults {
18 name: "aidl_defaults",
Chih-Hung Hsieh15607962017-10-02 10:03:55 -070019 cflags: [
Dan Willemsen8fd503f2016-10-04 20:04:36 -070020 "-Wall",
Dan Willemsen8fd503f2016-10-04 20:04:36 -070021 "-Werror",
Chih-Hung Hsieh15607962017-10-02 10:03:55 -070022 "-Wextra",
Dan Willemsen8fd503f2016-10-04 20:04:36 -070023 ],
24 whole_static_libs: ["libgtest_prod"],
25 static_libs: [
26 "libbase",
27 "libcutils",
28 ],
29 target: {
30 windows: {
31 enabled: true,
32 },
33 },
34}
35
36// Logic shared between aidl and its unittests
37cc_library_host_static {
38 name: "libaidl-common",
39 defaults: ["aidl_defaults"],
40
Dan Willemsen8fd503f2016-10-04 20:04:36 -070041 srcs: [
42 "aidl.cpp",
Jiyong Park3656c3c2018-08-01 20:02:01 +090043 "aidl_apicheck.cpp",
Dan Willemsen8fd503f2016-10-04 20:04:36 -070044 "aidl_language.cpp",
45 "aidl_language_l.ll",
46 "aidl_language_y.yy",
Jiyong Park1deecc32018-07-17 01:14:41 +090047 "aidl_typenames.cpp",
Steven Moreland860b1942018-08-16 14:59:28 -070048 "aidl_to_cpp.cpp",
Jiyong Park1d2df7d2018-07-23 15:22:50 +090049 "aidl_to_java.cpp",
Dan Willemsen8fd503f2016-10-04 20:04:36 -070050 "ast_cpp.cpp",
51 "ast_java.cpp",
52 "code_writer.cpp",
53 "generate_cpp.cpp",
54 "generate_java.cpp",
55 "generate_java_binder.cpp",
56 "import_resolver.cpp",
57 "line_reader.cpp",
58 "io_delegate.cpp",
59 "options.cpp",
60 "type_cpp.cpp",
61 "type_java.cpp",
62 "type_namespace.cpp",
63 ],
64}
65
66// aidl executable
67cc_binary_host {
68 name: "aidl",
69 defaults: ["aidl_defaults"],
Jiyong Park74595c12018-07-23 15:22:50 +090070 srcs: ["main.cpp"],
Dan Willemsen8fd503f2016-10-04 20:04:36 -070071 static_libs: [
72 "libaidl-common",
73 "libbase",
74 ],
75}
76
77// aidl-cpp executable
78cc_binary_host {
79 name: "aidl-cpp",
80 defaults: ["aidl_defaults"],
81 srcs: ["main_cpp.cpp"],
82 static_libs: [
83 "libaidl-common",
84 "libbase",
85 ],
86}
87
88// Unit tests
89cc_test_host {
90 name: "aidl_unittests",
91
92 cflags: [
93 "-Wall",
94 "-Wextra",
95 "-Werror",
96 "-g",
97 "-DUNIT_TEST",
98 ],
Steven Moreland1c41e972018-07-09 16:07:00 -070099
Dan Willemsen8fd503f2016-10-04 20:04:36 -0700100 srcs: [
101 "aidl_unittest.cpp",
102 "ast_cpp_unittest.cpp",
103 "ast_java_unittest.cpp",
Jiyong Park22b4ecd2018-07-23 23:34:42 +0900104 "code_writer_unittest.cpp",
Dan Willemsen8fd503f2016-10-04 20:04:36 -0700105 "generate_cpp_unittest.cpp",
106 "io_delegate_unittest.cpp",
107 "options_unittest.cpp",
108 "tests/end_to_end_tests.cpp",
109 "tests/fake_io_delegate.cpp",
110 "tests/main.cpp",
111 "tests/test_data_example_interface.cpp",
112 "tests/test_data_ping_responder.cpp",
113 "tests/test_data_string_constants.cpp",
114 "tests/test_util.cpp",
115 "type_cpp_unittest.cpp",
116 "type_java_unittest.cpp",
117 ],
118
119 static_libs: [
120 "libaidl-common",
121 "libbase",
122 "libcutils",
123 "libgmock_host",
124 ],
Dan Willemsen8fd503f2016-10-04 20:04:36 -0700125}
126
127//
128// Everything below here is used for integration testing of generated AIDL code.
129//
130cc_binary {
131 name: "aidl_test_sentinel_searcher",
132 srcs: ["tests/aidl_test_sentinel_searcher.cpp"],
133 cflags: [
134 "-Wall",
135 "-Wextra",
136 "-Werror",
Dan Willemsen8fd503f2016-10-04 20:04:36 -0700137 ],
138}
Dan Willemsen8f883612016-11-03 14:22:48 -0700139
140cc_defaults {
141 name: "aidl_test_defaults",
142 cflags: [
143 "-Wall",
144 "-Wextra",
145 "-Werror",
Dan Willemsen8f883612016-11-03 14:22:48 -0700146 ],
147 shared_libs: [
148 "libbase",
149 "libbinder",
150 "liblog",
151 "libutils",
152 ],
153}
154
155cc_library_shared {
156 name: "libaidl-integration-test",
157 defaults: ["aidl_test_defaults"],
158 aidl: {
159 export_aidl_headers: true,
160 local_include_dirs: ["tests"],
161 include_dirs: ["frameworks/native/aidl/binder"],
162 },
163 srcs: [
164 "tests/android/aidl/tests/ITestService.aidl",
165 "tests/android/aidl/tests/INamedCallback.aidl",
Steven Moreland5557f1c2018-07-02 13:50:23 -0700166 "tests/android/aidl/tests/StructuredParcelable.aidl",
Dan Willemsen8f883612016-11-03 14:22:48 -0700167 "tests/simple_parcelable.cpp",
168 ],
169}
170
171cc_binary {
172 name: "aidl_test_service",
173 defaults: ["aidl_test_defaults"],
174 shared_libs: ["libaidl-integration-test"],
175 srcs: ["tests/aidl_test_service.cpp"],
176}
177
178cc_binary {
179 name: "aidl_test_client",
180 defaults: ["aidl_test_defaults"],
181 shared_libs: ["libaidl-integration-test"],
182 srcs: [
183 "tests/aidl_test_client.cpp",
184 "tests/aidl_test_client_file_descriptors.cpp",
185 "tests/aidl_test_client_parcelables.cpp",
186 "tests/aidl_test_client_nullables.cpp",
187 "tests/aidl_test_client_primitives.cpp",
188 "tests/aidl_test_client_utf8_strings.cpp",
189 "tests/aidl_test_client_service_exceptions.cpp",
Jiyong Park75e1a742018-07-04 12:31:23 +0900190 "tests/aidl_test_client_defaultimpl.cpp",
Dan Willemsen8f883612016-11-03 14:22:48 -0700191 ],
192}
Steven Moreland0ae34602018-06-28 10:08:19 -0700193
194android_app {
195 name: "aidl_test_services",
196 platform_apis: true,
197 // Turn off Java optimization tools to speed up our test iterations.
198 optimize: {
199 enabled: false,
200 },
201 dex_preopt: {
202 enabled: false,
203 },
204 certificate: "platform",
205 manifest: "tests/java_app/AndroidManifest.xml",
206 resource_dirs: ["tests/java_app/resources"],
207 srcs: [
208 "tests/android/aidl/tests/INamedCallback.aidl",
209 "tests/android/aidl/tests/ITestService.aidl",
Steven Moreland5557f1c2018-07-02 13:50:23 -0700210 "tests/android/aidl/tests/StructuredParcelable.aidl",
Steven Moreland0ae34602018-06-28 10:08:19 -0700211 "tests/java_app/src/android/aidl/tests/NullableTests.java",
212 "tests/java_app/src/android/aidl/tests/SimpleParcelable.java",
213 "tests/java_app/src/android/aidl/tests/TestFailException.java",
214 "tests/java_app/src/android/aidl/tests/TestLogger.java",
215 "tests/java_app/src/android/aidl/tests/TestServiceClient.java",
216 ],
217 aidl: {
218 include_dirs: [
219 "system/tools/aidl/tests/",
220 "frameworks/native/aidl/binder",
221 ],
222 },
223}