Collect ravenwood stats *.csv files under the testcases dir
Test: atest ravenwood-stats-checker
Bug: 292141694
Change-Id: I51a295d940e4a02f33341614ca4b80bca330200c
diff --git a/Ravenwood.bp b/Ravenwood.bp
index f43c37b..6237e3e 100644
--- a/Ravenwood.bp
+++ b/Ravenwood.bp
@@ -77,6 +77,19 @@
],
}
+// Extract the stats file.
+genrule {
+ name: "framework-minus-apex.ravenwood.stats",
+ defaults: ["ravenwood-internal-only-visibility-genrule"],
+ cmd: "cp $(in) $(out)",
+ srcs: [
+ ":framework-minus-apex.ravenwood-base{hoststubgen_framework-minus-apex_stats.csv}",
+ ],
+ out: [
+ "hoststubgen_framework-minus-apex_stats.csv",
+ ],
+}
+
java_library {
name: "services.core-for-hoststubgen",
installable: false, // host only jar.
@@ -135,6 +148,19 @@
],
}
+// Extract the stats file.
+genrule {
+ name: "services.core.ravenwood.stats",
+ defaults: ["ravenwood-internal-only-visibility-genrule"],
+ cmd: "cp $(in) $(out)",
+ srcs: [
+ ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
+ ],
+ out: [
+ "hoststubgen_services.core_stats.csv",
+ ],
+}
+
java_library {
name: "services.core.ravenwood-jarjar",
installable: false,
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index 178102e..f4337d4 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -154,3 +154,15 @@
srcs: ["ravenwood-services-jarjar-rules.txt"],
visibility: ["//frameworks/base"],
}
+
+// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
+// The "test" just shows the available stats filenames.
+sh_test_host {
+ name: "ravenwood-stats-checker",
+ src: "ravenwood-stats-checker.sh",
+ test_suites: ["general-tests"],
+ data: [
+ ":framework-minus-apex.ravenwood.stats",
+ ":services.core.ravenwood.stats",
+ ],
+}
diff --git a/ravenwood/ravenwood-stats-checker.sh b/ravenwood/ravenwood-stats-checker.sh
new file mode 100755
index 0000000..fb58e72
--- /dev/null
+++ b/ravenwood/ravenwood-stats-checker.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Just print the available *.csv filenames.
+echo '#Stats files:'
+ls *.csv
\ No newline at end of file