summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Vander Stoep <jeffv@google.com>2020-12-21 09:44:12 +0100
committerJeff Vander Stoep <jeffv@google.com>2020-12-21 09:44:12 +0100
commit307e57dab6b98fbcf834c7051db8bdcefb218e8d (patch)
treeb552acd95e6c887e310f6fc1953495e7c959698c
parente27fd4bfe992f057689a1c972b7ead1846bad8f2 (diff)
downloadtinyvec_macros-307e57dab6b98fbcf834c7051db8bdcefb218e8d.tar.gz
Add Android.bp
Test: mm Test: atest Change-Id: I2424638529d0a6553e9039357e78083b677e92eb
-rw-r--r--Android.bp28
-rw-r--r--TEST_MAPPING12
-rw-r--r--patches/std.diff13
-rw-r--r--src/lib.rs3
4 files changed, 56 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..2ed0149
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,28 @@
+// This file is generated by cargo2android.py --run --device --dependencies --tests.
+
+rust_library {
+ name: "libtinyvec_macros",
+ host_supported: true,
+ crate_name: "tinyvec_macros",
+ srcs: ["src/lib.rs"],
+ edition: "2018",
+}
+
+rust_defaults {
+ name: "tinyvec_macros_defaults",
+ crate_name: "tinyvec_macros",
+ srcs: ["src/lib.rs"],
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ edition: "2018",
+}
+
+rust_test_host {
+ name: "tinyvec_macros_host_test_src_lib",
+ defaults: ["tinyvec_macros_defaults"],
+}
+
+rust_test {
+ name: "tinyvec_macros_device_test_src_lib",
+ defaults: ["tinyvec_macros_defaults"],
+}
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..a3393d8
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,12 @@
+// Generated by cargo2android.py for tests in Android.bp
+{
+ "presubmit": [
+ {
+ "host": true,
+ "name": "tinyvec_macros_host_test_src_lib"
+ },
+ {
+ "name": "tinyvec_macros_device_test_src_lib"
+ }
+ ]
+}
diff --git a/patches/std.diff b/patches/std.diff
new file mode 100644
index 0000000..89735b5
--- /dev/null
+++ b/patches/std.diff
@@ -0,0 +1,13 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 4790e08..b1896fb 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -1,5 +1,8 @@
+ #![no_std]
+
++// ANDROID: Unconditionally use std to allow building as a dylib.
++extern crate std;
++
+ #[macro_export]
+ macro_rules! impl_mirrored {
+ {
diff --git a/src/lib.rs b/src/lib.rs
index 4790e08..b1896fb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,5 +1,8 @@
#![no_std]
+// ANDROID: Unconditionally use std to allow building as a dylib.
+extern crate std;
+
#[macro_export]
macro_rules! impl_mirrored {
{