blob: 85e2e9c414559300c31a8861a4b700c8d885e0c8 [file] [log] [blame]
cc_library_headers {
name: "libnetd_resolv_headers",
export_include_dirs: ["include"],
}
// Used only by dns_responder_client_ndk.cpp for ResolverStats.h
// TODO: refactor stats to use a Parcel and eliminate this dependency
cc_library_headers {
name: "libnetd_resolv_internal_headers",
export_include_dirs: ["."],
}
aidl_interface {
name: "dnsresolver_aidl_interface",
local_include_dir: "binder",
srcs: [
"binder/android/net/IDnsResolver.aidl",
"binder/android/net/ResolverHostsParcel.aidl",
"binder/android/net/ResolverExperimentalOptionsParcel.aidl",
"binder/android/net/ResolverParamsParcel.aidl",
],
imports: [
"netd_event_listener_interface",
],
backend: {
java: {
apex_available: [
"com.android.bluetooth.updatable",
],
},
ndk: {
gen_log: true,
},
},
versions: [
"1",
"2",
"3",
],
}
cc_defaults {
name: "resolv_test_defaults",
// Note that, static link liblog and libbase is a hard requirement for resolv related tests
// because libbase is not compatible between Q and R for general platform build due
// to its log revelant functions changing. And most of resolv related tests must be able to run
// in Q.
static_libs: [
"libbase",
"liblog",
],
}
cc_library {
name: "libnetd_resolv",
version_script: "libnetd_resolv.map.txt",
stubs: {
versions: [
"1",
],
symbol_file: "libnetd_resolv.map.txt",
},
defaults: ["netd_defaults"],
srcs: [
"getaddrinfo.cpp",
"gethnamaddr.cpp",
"sethostent.cpp",
"res_cache.cpp",
"res_comp.cpp",
"res_debug.cpp",
"res_init.cpp",
"res_mkquery.cpp",
"res_query.cpp",
"res_send.cpp",
"res_stats.cpp",
"util.cpp",
"Dns64Configuration.cpp",
"DnsProxyListener.cpp",
"DnsQueryLog.cpp",
"DnsResolver.cpp",
"DnsResolverService.cpp",
"DnsStats.cpp",
"DnsTlsDispatcher.cpp",
"DnsTlsQueryMap.cpp",
"DnsTlsTransport.cpp",
"DnsTlsServer.cpp",
"DnsTlsSessionCache.cpp",
"DnsTlsSocket.cpp",
"PrivateDnsConfiguration.cpp",
"ResolverController.cpp",
"ResolverEventReporter.cpp",
],
// Link most things statically to minimize our dependence on system ABIs.
stl: "libc++_static",
static_libs: [
"dnsresolver_aidl_interface-unstable-ndk_platform",
"libbase",
"libcutils",
"libjsoncpp",
"libnetdutils",
"libprotobuf-cpp-lite",
"libstatslog_resolv",
"libstatspush_compat",
"libsysutils",
"libutils", // Used by libstatslog_resolv
"netd_event_listener_interface-ndk_platform",
"server_configurable_flags",
"stats_proto",
],
// libcrypto needs to be used as a shared library because it performs an
// integrity check (against a checksum) that is not supported for static
// libs. See http://b/141248879
// We're also adding libssl here to treat it consistently.
// liblog is added as a shared library because it provides stable C API
// from the platform; we don't need to include it in this module by
// statically linking to it. Doing so is even dangerous because the socket
// protocol to logd implemented in the library isn't guaranteed to be
// stable. See b/151051671
shared_libs: [
"libbinder_ndk",
"libcrypto",
"liblog", //Used by libstatslog_resolv
"libssl",
],
header_libs: [
"libnetd_client_headers",
],
runtime_libs: [
// Causes the linkerconfig to create a namespace link from resolv to the
// libstatssocket library within the statsd apex
"libstatssocket",
],
export_include_dirs: ["include"],
product_variables: {
debuggable: {
cppflags: [
"-DRESOLV_ALLOW_VERBOSE_LOGGING=1",
"-DRESOLV_INJECT_CA_CERTIFICATE=1",
],
},
},
header_abi_checker: {
enabled: true,
symbol_file: "libnetd_resolv.map.txt",
},
sanitize: {
cfi: true,
},
}
cc_library_static {
name: "stats_proto",
defaults: ["netd_defaults"],
proto: {
export_proto_headers: true,
type: "lite",
},
srcs: [
"stats.proto",
],
}
genrule {
name: "statslog_resolv.h",
tools: ["stats-log-api-gen"],
cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_resolv.h --module resolv --namespace android,net,stats",
out: [
"statslog_resolv.h",
],
}
genrule {
name: "statslog_resolv.cpp",
tools: ["stats-log-api-gen"],
cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_resolv.cpp --module resolv --namespace android,net,stats --importHeader statslog_resolv.h --supportQ",
out: [
"statslog_resolv.cpp",
],
}
cc_library_static {
name: "libstatslog_resolv",
generated_sources: ["statslog_resolv.cpp"],
generated_headers: ["statslog_resolv.h"],
defaults: ["netd_defaults"],
export_generated_headers: ["statslog_resolv.h"],
static_libs: [
"libcutils",
"libgtest_prod", // Used by libstatspush_compat
"libstatspush_compat",
],
}
filegroup {
name: "resolv_test_config_template",
srcs: [
"resolv_test_config_template.xml",
],
}
// TODO: Move this test to tests/
cc_test {
name: "resolv_unit_test",
test_suites: ["device-tests", "mts"],
require_root: true,
// TODO: Remove after b/152303924 fixing
test_config_template: ":resolv_test_config_template",
//TODO: drop root privileges and make it be an real unit test.
defaults: ["netd_defaults", "resolv_test_defaults"],
srcs: [
"resolv_cache_unit_test.cpp",
"resolv_callback_unit_test.cpp",
"resolv_tls_unit_test.cpp",
"resolv_unit_test.cpp",
"DnsStatsTest.cpp",
"DnsQueryLogTest.cpp",
],
shared_libs: [
"libcrypto",
"libbinder_ndk",
"libssl",
],
static_libs: [
"dnsresolver_aidl_interface-unstable-ndk_platform",
"netd_event_listener_interface-ndk_platform",
"libcutils",
"libgmock",
"libnetd_resolv",
"libnetd_test_dnsresponder",
"libnetd_test_resolv_utils",
"libnetdutils",
"libprotobuf-cpp-lite",
"libstatslog_resolv",
"libstatspush_compat",
"libsysutils",
"libutils",
"resolv_stats_test_utils",
"server_configurable_flags",
"stats_proto",
],
compile_multilib: "first",
}