From 8d0b6101a8152c876193ab5f245fdddc981c6cb8 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Fri, 10 Nov 2023 16:56:09 +0000 Subject: Migrate to cargo_embargo. Bug: 293289578 Test: Ran cargo_embargo, compared Android.bp Change-Id: Ifc3d48c113aac58147a68c4367e7fca142f5a526 --- Android.bp | 39 +++++++++++++++++++++------------------ cargo2android.json | 13 ------------- cargo_embargo.json | 5 +++++ 3 files changed, 26 insertions(+), 31 deletions(-) delete mode 100644 cargo2android.json create mode 100644 cargo_embargo.json diff --git a/Android.bp b/Android.bp index 7ea5eee..3a8f953 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 { @@ -43,41 +43,44 @@ rust_test { ], } -rust_defaults { - name: "downcast-rs_test_defaults", - crate_name: "downcast_rs", +rust_test { + name: "downcast-rs_test_tests_import_via_macro_use", + host_supported: true, + crate_name: "import_via_macro_use", cargo_env_compat: true, cargo_pkg_version: "1.2.0", + srcs: ["tests/import_via_macro_use.rs"], test_suites: ["general-tests"], auto_gen_config: true, + test_options: { + unit_test: true, + }, edition: "2015", features: [ "default", "std", ], - rustlibs: [ - "libdowncast_rs", - ], -} - -rust_test { - name: "downcast-rs_test_tests_import_via_macro_use", - defaults: ["downcast-rs_test_defaults"], - host_supported: true, - srcs: ["tests/import_via_macro_use.rs"], - test_options: { - unit_test: true, - }, + rustlibs: ["libdowncast_rs"], } rust_test { name: "downcast-rs_test_tests_use_via_namespace", - defaults: ["downcast-rs_test_defaults"], host_supported: true, + crate_name: "use_via_namespace", + cargo_env_compat: true, + cargo_pkg_version: "1.2.0", srcs: ["tests/use_via_namespace.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2015", + features: [ + "default", + "std", + ], + rustlibs: ["libdowncast_rs"], } rust_library { diff --git a/cargo2android.json b/cargo2android.json deleted file mode 100644 index 7e748a8..0000000 --- a/cargo2android.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "apex-available": [ - "//apex_available:platform", - "//apex_available:anyapex" - ], - "dependencies": true, - "device": true, - "min-sdk-version": "29", - "product-available": true, - "run": true, - "tests": true, - "vendor-available": true -} diff --git a/cargo_embargo.json b/cargo_embargo.json new file mode 100644 index 0000000..16616e0 --- /dev/null +++ b/cargo_embargo.json @@ -0,0 +1,5 @@ +{ + "min_sdk_version": "29", + "run_cargo": false, + "tests": true +} -- cgit v1.2.3