From 2797491abe0909c2dbe8e498febd6766f964ca74 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 14 Nov 2023 14:38:08 +0000 Subject: Migrate to cargo_embargo. Bug: 293289578 Test: Ran cargo_embargo, compared Android.bp Change-Id: Icfef0b01190644cab152f0744f2306533f62e86e --- Android.bp | 112 ++++++++++++++++++++++++++++++++++++++++++----------- cargo2android.json | 9 ----- cargo_embargo.json | 8 ++++ 3 files changed, 98 insertions(+), 31 deletions(-) delete mode 100644 cargo2android.json create mode 100644 cargo_embargo.json diff --git a/Android.bp b/Android.bp index 8b5ecf9..edd8df6 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 { @@ -63,13 +63,18 @@ rust_test { proc_macros: ["librustversion"], } -rust_defaults { - name: "crossbeam-utils_test_defaults", - crate_name: "crossbeam_utils", +rust_test { + name: "crossbeam-utils_test_tests_atomic_cell", + host_supported: true, + crate_name: "atomic_cell", cargo_env_compat: true, cargo_pkg_version: "0.8.15", + srcs: ["tests/atomic_cell.rs"], test_suites: ["general-tests"], auto_gen_config: true, + test_options: { + unit_test: true, + }, edition: "2018", features: [ "default", @@ -83,64 +88,129 @@ rust_defaults { proc_macros: ["librustversion"], } -rust_test { - name: "crossbeam-utils_test_tests_atomic_cell", - defaults: ["crossbeam-utils_test_defaults"], - host_supported: true, - srcs: ["tests/atomic_cell.rs"], - test_options: { - unit_test: true, - }, -} - rust_test { name: "crossbeam-utils_test_tests_cache_padded", - defaults: ["crossbeam-utils_test_defaults"], host_supported: true, + crate_name: "cache_padded", + cargo_env_compat: true, + cargo_pkg_version: "0.8.15", srcs: ["tests/cache_padded.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2018", + features: [ + "default", + "std", + ], + rustlibs: [ + "libcfg_if", + "libcrossbeam_utils", + "librand", + ], + proc_macros: ["librustversion"], } rust_test { name: "crossbeam-utils_test_tests_parker", - defaults: ["crossbeam-utils_test_defaults"], host_supported: true, + crate_name: "parker", + cargo_env_compat: true, + cargo_pkg_version: "0.8.15", srcs: ["tests/parker.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2018", + features: [ + "default", + "std", + ], + rustlibs: [ + "libcfg_if", + "libcrossbeam_utils", + "librand", + ], + proc_macros: ["librustversion"], } rust_test { name: "crossbeam-utils_test_tests_sharded_lock", - defaults: ["crossbeam-utils_test_defaults"], host_supported: true, + crate_name: "sharded_lock", + cargo_env_compat: true, + cargo_pkg_version: "0.8.15", srcs: ["tests/sharded_lock.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2018", + features: [ + "default", + "std", + ], + rustlibs: [ + "libcfg_if", + "libcrossbeam_utils", + "librand", + ], + proc_macros: ["librustversion"], } rust_test { name: "crossbeam-utils_test_tests_thread", - defaults: ["crossbeam-utils_test_defaults"], host_supported: true, + crate_name: "thread", + cargo_env_compat: true, + cargo_pkg_version: "0.8.15", srcs: ["tests/thread.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2018", + features: [ + "default", + "std", + ], + rustlibs: [ + "libcfg_if", + "libcrossbeam_utils", + "librand", + ], + proc_macros: ["librustversion"], } rust_test { name: "crossbeam-utils_test_tests_wait_group", - defaults: ["crossbeam-utils_test_defaults"], host_supported: true, + crate_name: "wait_group", + cargo_env_compat: true, + cargo_pkg_version: "0.8.15", srcs: ["tests/wait_group.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2018", + features: [ + "default", + "std", + ], + rustlibs: [ + "libcfg_if", + "libcrossbeam_utils", + "librand", + ], + proc_macros: ["librustversion"], } rust_library { @@ -155,9 +225,7 @@ rust_library { "default", "std", ], - rustlibs: [ - "libcfg_if", - ], + rustlibs: ["libcfg_if"], apex_available: [ "//apex_available:platform", "com.android.virt", diff --git a/cargo2android.json b/cargo2android.json deleted file mode 100644 index 6e516e0..0000000 --- a/cargo2android.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "apex-available": [ - "//apex_available:platform", - "com.android.virt" - ], - "device": true, - "run": true, - "tests": true -} \ No newline at end of file diff --git a/cargo_embargo.json b/cargo_embargo.json new file mode 100644 index 0000000..fcc96ec --- /dev/null +++ b/cargo_embargo.json @@ -0,0 +1,8 @@ +{ + "apex_available": [ + "//apex_available:platform", + "com.android.virt" + ], + "run_cargo": false, + "tests": true +} -- cgit v1.2.3