diff options
-rw-r--r-- | Android.bp | 50 | ||||
-rw-r--r-- | patches/std.diff | 14 | ||||
-rw-r--r-- | src/untrusted.rs | 3 |
3 files changed, 67 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..52ab13d --- /dev/null +++ b/Android.bp @@ -0,0 +1,50 @@ +// This file is generated by cargo2android.py --run --device --dependencies --tests. + +rust_library { + name: "libuntrusted", + host_supported: true, + crate_name: "untrusted", + srcs: ["src/untrusted.rs"], + edition: "2018", +} + +rust_defaults { + name: "untrusted_defaults", + crate_name: "untrusted", + srcs: ["src/untrusted.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + edition: "2018", +} + +rust_test_host { + name: "untrusted_host_test_src_untrusted", + defaults: ["untrusted_defaults"], +} + +rust_test { + name: "untrusted_device_test_src_untrusted", + defaults: ["untrusted_defaults"], +} + +rust_defaults { + name: "untrusted_defaults_tests", + crate_name: "tests", + srcs: ["tests/tests.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + edition: "2018", + rustlibs: [ + "libuntrusted", + ], +} + +rust_test_host { + name: "untrusted_host_test_tests_tests", + defaults: ["untrusted_defaults_tests"], +} + +rust_test { + name: "untrusted_device_test_tests_tests", + defaults: ["untrusted_defaults_tests"], +} diff --git a/patches/std.diff b/patches/std.diff new file mode 100644 index 0000000..e3ebe5e --- /dev/null +++ b/patches/std.diff @@ -0,0 +1,14 @@ +diff --git a/src/untrusted.rs b/src/untrusted.rs +index 2f88bb4..b9f1439 100644 +--- a/src/untrusted.rs ++++ b/src/untrusted.rs +@@ -102,6 +102,9 @@ + )] + #![no_std] + ++// ANDROID: Unconditionally use std to allow building as a dylib. ++extern crate std; ++ + /// A wrapper around `&'a [u8]` that helps in writing panic-free code. + /// + /// No methods of `Input` will ever panic. diff --git a/src/untrusted.rs b/src/untrusted.rs index 2f88bb4..b9f1439 100644 --- a/src/untrusted.rs +++ b/src/untrusted.rs @@ -102,6 +102,9 @@ )] #![no_std] +// ANDROID: Unconditionally use std to allow building as a dylib. +extern crate std; + /// A wrapper around `&'a [u8]` that helps in writing panic-free code. /// /// No methods of `Input` will ever panic. |