Snap for 8189365 from c7679fcbcb7f3504c41ec064ed129c82491b858f to tm-frc-networking-release
Change-Id: I30810769aabd03e6b9adeaf5992cb0c0a032dbd2
diff --git a/Android.bp b/Android.bp
index 95e1d67..54e1607 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,5 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
-// Do not modify this file as changes will be overridden on upgrade.
+// This file is generated by cargo2android.py --run --device --tests --dependencies --patch=patches/Android.bp.patch.
package {
default_applicable_licenses: ["external_rust_crates_rand_xorshift_license"],
@@ -42,8 +41,6 @@
name: "librand_xorshift",
host_supported: true,
crate_name: "rand_xorshift",
- cargo_env_compat: true,
- cargo_pkg_version: "0.3.0",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
@@ -51,21 +48,57 @@
],
}
+rust_defaults {
+ name: "rand_xorshift_defaults",
+ crate_name: "rand_xorshift",
+ srcs: ["src/lib.rs"],
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ edition: "2018",
+ rustlibs: [
+ // ANDROID: not really used
+ //"libbincode",
+ "librand_core",
+ ],
+}
+
+rust_test_host {
+ name: "rand_xorshift_host_test_src_lib",
+ defaults: ["rand_xorshift_defaults"],
+}
+
rust_test {
- name: "rand_xorshift_test_tests_mod",
- host_supported: true,
+ name: "rand_xorshift_device_test_src_lib",
+ defaults: ["rand_xorshift_defaults"],
+}
+
+rust_defaults {
+ name: "rand_xorshift_defaults_mod",
crate_name: "mod",
- cargo_env_compat: true,
- cargo_pkg_version: "0.3.0",
srcs: ["tests/mod.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
- test_options: {
- unit_test: true,
- },
edition: "2018",
rustlibs: [
+ // ANDROID: not really used
+ //"libbincode",
"librand_core",
"librand_xorshift",
],
}
+
+rust_test_host {
+ name: "rand_xorshift_host_test_tests_mod",
+ defaults: ["rand_xorshift_defaults_mod"],
+}
+
+rust_test {
+ name: "rand_xorshift_device_test_tests_mod",
+ defaults: ["rand_xorshift_defaults_mod"],
+}
+
+// dependent_library ["feature_list"]
+// bincode-1.3.1
+// byteorder-1.3.4 "default,std"
+// rand_core-0.6.0
+// serde-1.0.118 "default,std"
diff --git a/TEST_MAPPING b/TEST_MAPPING
index ae94940..c30a7b6 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,18 +1,11 @@
-// Generated by update_crate_tests.py for tests that depend on this crate.
+// Generated by cargo2android.py for tests in Android.bp
{
- "imports": [
- {
- "path": "external/rust/crates/ryu"
- }
- ],
"presubmit": [
{
- "name": "rand_xorshift_test_tests_mod"
- }
- ],
- "presubmit-rust": [
+ "name": "rand_xorshift_device_test_src_lib"
+ },
{
- "name": "rand_xorshift_test_tests_mod"
+ "name": "rand_xorshift_device_test_tests_mod"
}
]
}
diff --git a/cargo2android.json b/cargo2android.json
deleted file mode 100644
index cf692e4..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "dependencies": true,
- "dependency-blocklist": [
- "bincode"
- ],
- "device": true,
- "run": true,
- "tests": true
-}
\ No newline at end of file
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
new file mode 100644
index 0000000..13b71ce
--- /dev/null
+++ b/patches/Android.bp.patch
@@ -0,0 +1,24 @@
+diff --git a/Android.bp b/Android.bp
+index 704654e..0e6db92 100644
+--- a/Android.bp
++++ b/Android.bp
+@@ -19,7 +19,8 @@ rust_defaults {
+ auto_gen_config: true,
+ edition: "2018",
+ rustlibs: [
+- "libbincode",
++ // ANDROID: not really used
++ //"libbincode",
+ "librand_core",
+ ],
+ }
+@@ -42,7 +43,8 @@ rust_defaults {
+ auto_gen_config: true,
+ edition: "2018",
+ rustlibs: [
+- "libbincode",
++ // ANDROID: not really used
++ //"libbincode",
+ "librand_core",
+ "librand_xorshift",
+ ],