Fix Android.bp for libartservice and its tests.
- Define `libartservice_defaults` to allow variants (e.g.,
debug/non-debug variants).
- Remove `export_include_dirs` and `export_shared_lib_headers` because
libartservice is a JNI lib, which shouldn't export headers for c++
code to include.
- Use source code in unit tests.
Bug: 177273468
Test: m com.android.art
Test: atest art_standalone_libartservice_tests
Test: out/host/linux-x86/obj/PACKAGING/art-host-gtest_intermediates/art_libartservice_tests32.xml
Change-Id: Ie8bb94c90a15d1b94cf6c812087a568848b5f9da
diff --git a/libartservice/service/Android.bp b/libartservice/service/Android.bp
index ebf8dd5..55b63b3 100644
--- a/libartservice/service/Android.bp
+++ b/libartservice/service/Android.bp
@@ -21,25 +21,29 @@
default_applicable_licenses: ["art_license"],
}
-cc_library {
- // This native library contains JNI support code for the ART Service Java
- // Language library.
-
- name: "libartservice",
+// This native library contains JNI support code for the ART Service Java
+// Language library.
+cc_defaults {
+ name: "libartservice_defaults",
defaults: ["art_defaults"],
host_supported: true,
srcs: [
"native/service.cc",
],
- export_include_dirs: ["."],
+ shared_libs: [
+ "libbase",
+ ],
+}
+
+cc_library {
+ name: "libartservice",
+ defaults: ["libartservice_defaults"],
apex_available: [
"com.android.art",
"com.android.art.debug",
],
shared_libs: [
- "libbase",
],
- export_shared_lib_headers: ["libbase"],
}
// Provides the API and implementation of the ART Service class that will be
@@ -98,13 +102,10 @@
art_cc_defaults {
name: "art_libartservice_tests_defaults",
+ defaults: ["libartservice_defaults"],
srcs: [
"native/service_test.cc",
],
- shared_libs: [
- "libbase",
- "libartservice",
- ],
}
// Version of ART gtest `art_libartservice_tests` bundled with the ART APEX on target.