summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2019-02-01 22:33:54 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-02-01 22:33:54 +0000
commit81ffeb8a1e6afca3f044130d873bf1d273cadc89 (patch)
treef021453e0bf0bd396235ddae548b4356b68e25e7
parent0f41ed8a98ec15633e1c42e001bb5c0c96fc034c (diff)
parentd9e2216b97da3da553b07f431ac4f2dd1f727e21 (diff)
Merge "ART: Hook Runtime APEX checker into build"
-rw-r--r--Android.mk5
-rw-r--r--build/apex/Android.bp69
2 files changed, 74 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 526cd59c7f..1a7ed43ca4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -352,13 +352,18 @@ ifeq (true,$(art_target_include_debug_build))
# Module with both release and debug variants, as well as
# additional tools.
TARGET_RUNTIME_APEX := com.android.runtime.debug
+ APEX_TEST_MODULE := art-check-debug-apex-gen-fakebin
else
# Release module (without debug variants nor tools).
TARGET_RUNTIME_APEX := com.android.runtime.release
+ APEX_TEST_MODULE := art-check-release-apex-gen-fakebin
endif
LOCAL_MODULE := com.android.runtime
LOCAL_REQUIRED_MODULES := $(TARGET_RUNTIME_APEX)
+ifneq ($(HOST_OS),darwin)
+ LOCAL_REQUIRED_MODULES += $(APEX_TEST_MODULE)
+endif
# Clear locally used variable.
art_target_include_debug_build :=
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index 4a6637b3b1..e3e5b6e6f1 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -230,3 +230,72 @@ art_apex {
},
},
}
+
+python_binary_host {
+ name: "art-apex-tester",
+ srcs: ["art_apex_test.py"],
+ main: "art_apex_test.py",
+ version: {
+ py2: {
+ enabled: false,
+ },
+ py3: {
+ enabled: true,
+ },
+ },
+}
+
+// Genrules so we can run the checker, and empty Java library so that it gets executed.
+
+genrule {
+ name: "art-check-release-apex-gen",
+ srcs: [":com.android.runtime.release"],
+ tools: [
+ "art-apex-tester",
+ "debugfs",
+ ],
+ cmd: "$(location art-apex-tester)"
+ + " --debugfs $(location debugfs)"
+ + " --tmpdir $(genDir)"
+ + " $(in)"
+ + " && touch $(out)",
+ out: ["art-check-release-apex-gen.dummy"],
+}
+cc_prebuilt_binary {
+ name: "art-check-release-apex-gen-fakebin",
+ srcs: [":art-check-release-apex-gen"],
+ host_supported: true,
+ device_supported: false,
+ target: {
+ darwin: {
+ enabled: false, // No python3.
+ },
+ },
+}
+
+genrule {
+ name: "art-check-debug-apex-gen",
+ srcs: [":com.android.runtime.debug"],
+ tools: [
+ "art-apex-tester",
+ "debugfs",
+ ],
+ cmd: "$(location art-apex-tester)"
+ + " --debugfs $(location debugfs)"
+ + " --tmpdir $(genDir)"
+ + " --debug"
+ + " $(in)"
+ + " && touch $(out)",
+ out: ["art-check-debug-apex-gen.dummy"],
+}
+cc_prebuilt_binary {
+ name: "art-check-debug-apex-gen-fakebin",
+ srcs: [":art-check-debug-apex-gen"],
+ host_supported: true,
+ device_supported: false,
+ target: {
+ darwin: {
+ enabled: false, // No python3.
+ },
+ },
+}