blob: 09b52a94be629ab5fc697e7f7c72ff4e33a7bd67 [file] [log] [blame]
//
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
cc_defaults {
name: "aidl_defaults",
cflags: [
"-Wall",
"-Werror",
"-Wextra",
],
whole_static_libs: ["libgtest_prod"],
static_libs: [
"libbase",
"libcutils",
],
target: {
windows: {
enabled: true,
},
host: {
cflags: [
"-O0",
"-g",
],
},
},
product_variables: {
platform_sdk_version: {
cflags: ["-DPLATFORM_SDK_VERSION=%d"],
},
},
}
// Logic shared between aidl and its unittests
cc_library_static {
name: "libaidl-common",
defaults: ["aidl_defaults"],
host_supported: true,
srcs: [
"aidl.cpp",
"aidl_checkapi.cpp",
"aidl_const_expressions.cpp",
"aidl_language.cpp",
"aidl_language_l.ll",
"aidl_language_y.yy",
"aidl_typenames.cpp",
"aidl_to_cpp.cpp",
"aidl_to_java.cpp",
"aidl_to_ndk.cpp",
"ast_cpp.cpp",
"ast_java.cpp",
"code_writer.cpp",
"generate_cpp.cpp",
"aidl_to_cpp_common.cpp",
"generate_ndk.cpp",
"generate_java.cpp",
"generate_java_binder.cpp",
"generate_aidl_mappings.cpp",
"import_resolver.cpp",
"line_reader.cpp",
"io_delegate.cpp",
"options.cpp",
],
yacc: {
gen_location_hh: true,
gen_position_hh: true,
},
}
// aidl executable
cc_binary_host {
name: "aidl",
defaults: ["aidl_defaults"],
srcs: ["main.cpp"],
static_libs: [
"libaidl-common",
"libbase",
"liblog",
],
}
// aidl-cpp legacy executable, please use 'aidl' instead
cc_binary_host {
name: "aidl-cpp",
defaults: ["aidl_defaults"],
srcs: ["main.cpp"],
cflags: ["-DAIDL_CPP_BUILD"],
static_libs: [
"libaidl-common",
"libbase",
"liblog",
],
}
// Unit tests
cc_test {
name: "aidl_unittests",
host_supported: true,
test_suites: ["device-tests"],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
"-g",
],
srcs: [
"aidl_unittest.cpp",
"ast_cpp_unittest.cpp",
"ast_java_unittest.cpp",
"code_writer_unittest.cpp",
"generate_cpp_unittest.cpp",
"io_delegate_unittest.cpp",
"options_unittest.cpp",
"tests/end_to_end_tests.cpp",
"tests/fake_io_delegate.cpp",
"tests/main.cpp",
"tests/test_data_example_interface.cpp",
"tests/test_data_ping_responder.cpp",
"tests/test_data_string_constants.cpp",
"tests/test_util.cpp",
],
static_libs: [
"libaidl-common",
"libbase",
"libcutils",
"libgmock",
"liblog",
],
}
cc_fuzz {
name: "aidl_parser_fuzzer",
host_supported: true,
dictionary: "tests/aidl_parser_fuzzer.dict",
corpus: [
"tests/corpus/*",
],
fuzz_config: {
cc: [
"smoreland@google.com",
"jiyong@google.com",
"jeongik@google.com",
],
},
srcs: [
"tests/aidl_parser_fuzzer.cpp",
"tests/fake_io_delegate.cpp",
"tests/test_util.cpp",
],
static_libs: [
"libaidl-common",
"libbase",
"libcutils",
"liblog",
],
// Enable this to show additional information about what is being parsed during fuzzing.
// cflags: ["-DFUZZ_LOG"],
}
//
// Everything below here is used for integration testing of generated AIDL code.
//
cc_test {
name: "aidl_test_sentinel_searcher",
gtest: false,
srcs: ["tests/aidl_test_sentinel_searcher.cpp"],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
}
cc_defaults {
name: "aidl_test_defaults",
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
shared_libs: [
"libbase",
"libbinder",
"liblog",
"libutils",
],
}
filegroup {
name: "libaidl-integration-test-files",
srcs: ["tests/android/aidl/tests/*.aidl"],
path: "tests",
}
cc_library_static {
name: "libaidl-integration-test",
defaults: ["aidl_test_defaults"],
aidl: {
export_aidl_headers: true,
local_include_dirs: ["tests"],
include_dirs: ["frameworks/native/aidl/binder"],
},
srcs: [
":libaidl-integration-test-files",
"tests/simple_parcelable.cpp",
],
}
cc_test {
name: "aidl_test_service",
gtest: false,
defaults: ["aidl_test_defaults"],
static_libs: ["libaidl-integration-test"],
srcs: ["tests/aidl_test_service.cpp"],
}
cc_test {
name: "aidl_test_client",
gtest: false,
defaults: ["aidl_test_defaults"],
static_libs: ["libaidl-integration-test"],
srcs: [
"tests/aidl_test_client.cpp",
"tests/aidl_test_client_file_descriptors.cpp",
"tests/aidl_test_client_parcelables.cpp",
"tests/aidl_test_client_nullables.cpp",
"tests/aidl_test_client_primitives.cpp",
"tests/aidl_test_client_utf8_strings.cpp",
"tests/aidl_test_client_service_exceptions.cpp",
"tests/aidl_test_client_defaultimpl.cpp",
],
}
android_app {
name: "aidl_test_services",
platform_apis: true,
// Turn off Java optimization tools to speed up our test iterations.
optimize: {
enabled: false,
},
dex_preopt: {
enabled: false,
},
certificate: "platform",
manifest: "tests/java_app/AndroidManifest.xml",
resource_dirs: ["tests/java_app/resources"],
srcs: [
"tests/android/aidl/tests/*.aidl",
"tests/android/aidl/tests/generic/*.aidl",
"tests/android/aidl/tests/map/*.aidl",
"tests/java_app/src/android/aidl/tests/GenericTests.java",
"tests/java_app/src/android/aidl/tests/MapTests.java",
"tests/java_app/src/android/aidl/tests/NullableTests.java",
"tests/java_app/src/android/aidl/tests/SimpleParcelable.java",
"tests/java_app/src/android/aidl/tests/TestFailException.java",
"tests/java_app/src/android/aidl/tests/TestLogger.java",
"tests/java_app/src/android/aidl/tests/TestServiceClient.java",
"tests/java_app/src/android/aidl/tests/generic/Pair.java",
],
aidl: {
include_dirs: [
"system/tools/aidl/tests/",
"frameworks/native/aidl/binder",
],
},
}
aidl_interface {
name: "aidl_test_loggable_interface",
local_include_dir: "tests",
srcs: [
"tests/android/aidl/loggable/ILoggableInterface.aidl",
],
backend: {
cpp: {
gen_log: true,
},
ndk: {
gen_log: true,
},
},
}