blob: 38b262557da37ad02390583e80afb84776f402b7 [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",
43 "aidl_language.cpp",
44 "aidl_language_l.ll",
45 "aidl_language_y.yy",
Jiyong Park1deecc32018-07-17 01:14:41 +090046 "aidl_typenames.cpp",
Dan Willemsen8fd503f2016-10-04 20:04:36 -070047 "ast_cpp.cpp",
48 "ast_java.cpp",
49 "code_writer.cpp",
50 "generate_cpp.cpp",
51 "generate_java.cpp",
52 "generate_java_binder.cpp",
53 "import_resolver.cpp",
54 "line_reader.cpp",
55 "io_delegate.cpp",
56 "options.cpp",
57 "type_cpp.cpp",
58 "type_java.cpp",
59 "type_namespace.cpp",
60 ],
61}
62
63// aidl executable
64cc_binary_host {
65 name: "aidl",
66 defaults: ["aidl_defaults"],
67 srcs: ["main_java.cpp"],
68 static_libs: [
69 "libaidl-common",
70 "libbase",
71 ],
72}
73
74// aidl-cpp executable
75cc_binary_host {
76 name: "aidl-cpp",
77 defaults: ["aidl_defaults"],
78 srcs: ["main_cpp.cpp"],
79 static_libs: [
80 "libaidl-common",
81 "libbase",
82 ],
83}
84
85// Unit tests
86cc_test_host {
87 name: "aidl_unittests",
88
89 cflags: [
90 "-Wall",
91 "-Wextra",
92 "-Werror",
93 "-g",
94 "-DUNIT_TEST",
95 ],
Steven Moreland1c41e972018-07-09 16:07:00 -070096
Dan Willemsen8fd503f2016-10-04 20:04:36 -070097 srcs: [
98 "aidl_unittest.cpp",
99 "ast_cpp_unittest.cpp",
100 "ast_java_unittest.cpp",
Jiyong Park22b4ecd2018-07-23 23:34:42 +0900101 "code_writer_unittest.cpp",
Dan Willemsen8fd503f2016-10-04 20:04:36 -0700102 "generate_cpp_unittest.cpp",
103 "io_delegate_unittest.cpp",
104 "options_unittest.cpp",
105 "tests/end_to_end_tests.cpp",
106 "tests/fake_io_delegate.cpp",
107 "tests/main.cpp",
108 "tests/test_data_example_interface.cpp",
109 "tests/test_data_ping_responder.cpp",
110 "tests/test_data_string_constants.cpp",
111 "tests/test_util.cpp",
112 "type_cpp_unittest.cpp",
113 "type_java_unittest.cpp",
114 ],
115
116 static_libs: [
117 "libaidl-common",
118 "libbase",
119 "libcutils",
120 "libgmock_host",
121 ],
Dan Willemsen8fd503f2016-10-04 20:04:36 -0700122}
123
124//
125// Everything below here is used for integration testing of generated AIDL code.
126//
127cc_binary {
128 name: "aidl_test_sentinel_searcher",
129 srcs: ["tests/aidl_test_sentinel_searcher.cpp"],
130 cflags: [
131 "-Wall",
132 "-Wextra",
133 "-Werror",
Dan Willemsen8fd503f2016-10-04 20:04:36 -0700134 ],
135}
Dan Willemsen8f883612016-11-03 14:22:48 -0700136
137cc_defaults {
138 name: "aidl_test_defaults",
139 cflags: [
140 "-Wall",
141 "-Wextra",
142 "-Werror",
Dan Willemsen8f883612016-11-03 14:22:48 -0700143 ],
144 shared_libs: [
145 "libbase",
146 "libbinder",
147 "liblog",
148 "libutils",
149 ],
150}
151
152cc_library_shared {
153 name: "libaidl-integration-test",
154 defaults: ["aidl_test_defaults"],
155 aidl: {
156 export_aidl_headers: true,
157 local_include_dirs: ["tests"],
158 include_dirs: ["frameworks/native/aidl/binder"],
159 },
160 srcs: [
161 "tests/android/aidl/tests/ITestService.aidl",
162 "tests/android/aidl/tests/INamedCallback.aidl",
Steven Moreland5557f1c2018-07-02 13:50:23 -0700163 "tests/android/aidl/tests/StructuredParcelable.aidl",
Dan Willemsen8f883612016-11-03 14:22:48 -0700164 "tests/simple_parcelable.cpp",
165 ],
166}
167
168cc_binary {
169 name: "aidl_test_service",
170 defaults: ["aidl_test_defaults"],
171 shared_libs: ["libaidl-integration-test"],
172 srcs: ["tests/aidl_test_service.cpp"],
173}
174
175cc_binary {
176 name: "aidl_test_client",
177 defaults: ["aidl_test_defaults"],
178 shared_libs: ["libaidl-integration-test"],
179 srcs: [
180 "tests/aidl_test_client.cpp",
181 "tests/aidl_test_client_file_descriptors.cpp",
182 "tests/aidl_test_client_parcelables.cpp",
183 "tests/aidl_test_client_nullables.cpp",
184 "tests/aidl_test_client_primitives.cpp",
185 "tests/aidl_test_client_utf8_strings.cpp",
186 "tests/aidl_test_client_service_exceptions.cpp",
Jiyong Park75e1a742018-07-04 12:31:23 +0900187 "tests/aidl_test_client_defaultimpl.cpp",
Dan Willemsen8f883612016-11-03 14:22:48 -0700188 ],
189}
Steven Moreland0ae34602018-06-28 10:08:19 -0700190
191android_app {
192 name: "aidl_test_services",
193 platform_apis: true,
194 // Turn off Java optimization tools to speed up our test iterations.
195 optimize: {
196 enabled: false,
197 },
198 dex_preopt: {
199 enabled: false,
200 },
201 certificate: "platform",
202 manifest: "tests/java_app/AndroidManifest.xml",
203 resource_dirs: ["tests/java_app/resources"],
204 srcs: [
205 "tests/android/aidl/tests/INamedCallback.aidl",
206 "tests/android/aidl/tests/ITestService.aidl",
Steven Moreland5557f1c2018-07-02 13:50:23 -0700207 "tests/android/aidl/tests/StructuredParcelable.aidl",
Steven Moreland0ae34602018-06-28 10:08:19 -0700208 "tests/java_app/src/android/aidl/tests/NullableTests.java",
209 "tests/java_app/src/android/aidl/tests/SimpleParcelable.java",
210 "tests/java_app/src/android/aidl/tests/TestFailException.java",
211 "tests/java_app/src/android/aidl/tests/TestLogger.java",
212 "tests/java_app/src/android/aidl/tests/TestServiceClient.java",
213 ],
214 aidl: {
215 include_dirs: [
216 "system/tools/aidl/tests/",
217 "frameworks/native/aidl/binder",
218 ],
219 },
220}