aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2018-01-18 21:29:41 -0800
committerAndreas Gampe <agampe@google.com>2018-01-18 21:30:04 -0800
commita884f906d45d5e7ee0f9112f5550d96cdd459ed5 (patch)
tree10b187d701c5aef4d3af24746399f47b83412d2c
parente0c976f12537d40cf246bc1ed7936e009fcc9d72 (diff)
downloaddexmaker-a884f906d45d5e7ee0f9112f5550d96cdd459ed5.tar.gz
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
-rw-r--r--Android.bp59
1 files changed, 23 insertions, 36 deletions
diff --git a/Android.bp b/Android.bp
index d61b3aa..be51825 100644
--- a/Android.bp
+++ b/Android.bp
@@ -45,10 +45,13 @@ java_library_static {
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 @@ cc_library_shared {
],
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 tests
+// Build agent for Dexmaker's inline MockMaker
cc_library_shared {
- name: "libmultiplejvmtiagentsinterferenceagent",
- 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",
+ name: "libdexmakerjvmtiagent",
+ defaults: [
+ "dexmaker_agent_defaults",
],
+ srcs: ["dexmaker-mockito-inline/src/main/jni/**/*.cc"],
+}
- header_libs: [
- "libopenjdkjvmti_headers",
+// 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"],
}
// Build Dexmaker's inline MockMaker, a plugin to Mockito