Migrate to cargo_embargo. am: ae392e9d1a

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/2833293

Change-Id: Idba6fe0d1f3d6e3efb9da5cc53efb82a713c0729
Signed-off-by: Automerger Merge Worker <[email protected]>
diff --git a/Android.bp b/Android.bp
index 2155d28..1393a8b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
+// This file is generated by cargo_embargo.
 // Do not modify this file as changes will be overridden on upgrade.
 
 package {
@@ -53,9 +53,7 @@
         "std",
         "tinyvec_macros",
     ],
-    rustlibs: [
-        "libtinyvec_macros",
-    ],
+    rustlibs: ["libtinyvec_macros"],
     apex_available: [
         "//apex_available:platform",
         "//apex_available:anyapex",
@@ -65,6 +63,62 @@
     min_sdk_version: "29",
 }
 
+rust_test {
+    name: "tinyvec_test_tests_arrayvec",
+    host_supported: true,
+    crate_name: "arrayvec",
+    cargo_env_compat: true,
+    cargo_pkg_version: "1.6.0",
+    srcs: ["tests/arrayvec.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
+    edition: "2018",
+    features: [
+        "alloc",
+        "default",
+        "std",
+        "tinyvec_macros",
+    ],
+    rustlibs: [
+        "libcriterion",
+        "libserde_test",
+        "libsmallvec",
+        "libtinyvec",
+        "libtinyvec_macros",
+    ],
+}
+
+rust_test {
+    name: "tinyvec_test_tests_tinyvec",
+    host_supported: true,
+    crate_name: "tinyvec",
+    cargo_env_compat: true,
+    cargo_pkg_version: "1.6.0",
+    srcs: ["tests/tinyvec.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
+    edition: "2018",
+    features: [
+        "alloc",
+        "default",
+        "std",
+        "tinyvec_macros",
+    ],
+    rustlibs: [
+        "libcriterion",
+        "libserde_test",
+        "libsmallvec",
+        "libtinyvec",
+        "libtinyvec_macros",
+    ],
+}
+
 rust_library_rlib {
     name: "libtinyvec_nostd",
     crate_name: "tinyvec",
@@ -86,46 +140,3 @@
     vendor_available: true,
     min_sdk_version: "29",
 }
-
-rust_defaults {
-    name: "tinyvec_test_defaults",
-    crate_name: "tinyvec",
-    cargo_env_compat: true,
-    cargo_pkg_version: "1.6.0",
-    test_suites: ["general-tests"],
-    auto_gen_config: true,
-    edition: "2018",
-    features: [
-        "alloc",
-        "default",
-        "std",
-        "tinyvec_macros",
-    ],
-    rustlibs: [
-        "libcriterion",
-        "libserde_test",
-        "libsmallvec",
-        "libtinyvec",
-        "libtinyvec_macros",
-    ],
-}
-
-rust_test {
-    name: "tinyvec_test_tests_arrayvec",
-    defaults: ["tinyvec_test_defaults"],
-    host_supported: true,
-    srcs: ["tests/arrayvec.rs"],
-    test_options: {
-        unit_test: true,
-    },
-}
-
-rust_test {
-    name: "tinyvec_test_tests_tinyvec",
-    defaults: ["tinyvec_test_defaults"],
-    host_supported: true,
-    srcs: ["tests/tinyvec.rs"],
-    test_options: {
-        unit_test: true,
-    },
-}
diff --git a/cargo2android.json b/cargo2android.json
deleted file mode 100644
index d3ea6e6..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "dependencies": true,
-  "device": true,
-  "min-sdk-version": "29",
-  "run": true,
-  "variants": [
-    {
-      "features": "alloc,default,std,tinyvec_macros",
-      "tests": true
-    },
-    {
-      "features": "",
-      "force-rlib": true,
-      "no-host": true,
-      "suffix": "_nostd",
-      "no-std": true
-    }
-  ]
-}
\ No newline at end of file
diff --git a/cargo_embargo.json b/cargo_embargo.json
new file mode 100644
index 0000000..f7826ad
--- /dev/null
+++ b/cargo_embargo.json
@@ -0,0 +1,31 @@
+{
+  "min_sdk_version": "29",
+  "module_blocklist": [
+    "tinyvec_test_src_lib"
+  ],
+  "run_cargo": false,
+  "variants": [
+    {
+      "features": [
+        "alloc",
+        "default",
+        "std",
+        "tinyvec_macros"
+      ],
+      "tests": true
+    },
+    {
+      "features": [],
+      "module_name_overrides": {
+        "libtinyvec": "libtinyvec_nostd"
+      },
+      "package": {
+        "tinyvec": {
+          "force_rlib": true,
+          "host_supported": false,
+          "no_std": true
+        }
+      }
+    }
+  ]
+}