Dexmaker: Build agents with the NDK
Change the configuration to build the agents with the NDK, so that they
are properly available in apps.
Bug: 65016018
Bug: 70901841
Test: mmma external/dexmaker
Test: cts-tradefed run singleCommand cts-dev -m CtsInlineMockingTestCases
Change-Id: I1d0ae8589783e25ef1a1b61048ac6e3693348adb
diff --git a/Android.bp b/Android.bp
index d61b3aa..be51825 100644
--- a/Android.bp
+++ b/Android.bp
@@ -45,10 +45,13 @@
srcs: ["dexmaker-mockito-inline-dispatcher/src/main/java/**/*.java"],
}
-// Build agent for Dexmaker's inline MockMaker
-cc_library_shared {
- name: "libdexmakerjvmtiagent",
- srcs: ["dexmaker-mockito-inline/src/main/jni/**/*.cc"],
+// Defaults for agent code.
+cc_defaults {
+ name: "dexmaker_agent_defaults",
+
+ // Compile with the NDK, so that the agent can be used in apps.
+ sdk_version: "current",
+ stl: "libc++_static",
host_supported: false,
device_supported: true,
@@ -68,51 +71,35 @@
],
static_libs: [
- "slicer",
+ "slicer_ndk",
],
shared_libs: [
"libz",
],
- header_libs: [
- "libopenjdkjvmti_headers",
+ // As an NDK-based library we cannot depend on libopenjdkjvmti_headers.
+ include_dirs: [
+ "art/openjdkjvmti/include",
],
}
+// Build agent for Dexmaker's inline MockMaker
+cc_library_shared {
+ name: "libdexmakerjvmtiagent",
+ defaults: [
+ "dexmaker_agent_defaults",
+ ],
+ srcs: ["dexmaker-mockito-inline/src/main/jni/**/*.cc"],
+}
+
// Build agent for Dexmaker's inline tests
cc_library_shared {
name: "libmultiplejvmtiagentsinterferenceagent",
+ defaults: [
+ "dexmaker_agent_defaults",
+ ],
srcs: ["dexmaker-mockito-inline-tests/src/main/jni/**/*.cc"],
-
- host_supported: false,
- device_supported: true,
-
- rtti: true,
-
- cflags: [
- "-std=c++11",
- "-Wall",
- "-Werror",
- "-Wno-unused-parameter",
- "-Wno-shift-count-overflow",
- "-Wno-error=non-virtual-dtor",
- "-Wno-sign-compare",
- "-Wno-switch",
- "-Wno-missing-braces",
- ],
-
- static_libs: [
- "slicer",
- ],
-
- shared_libs: [
- "libz",
- ],
-
- header_libs: [
- "libopenjdkjvmti_headers",
- ],
}
// Build Dexmaker's inline MockMaker, a plugin to Mockito