From 17c785e114dc625a82885ff4cc64d299351a9200 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 14 Nov 2023 18:34:15 +0000 Subject: Migrate to cargo_embargo. Bug: 293289578 Test: Ran cargo_embargo, compared Android.bp Change-Id: Ida1e3c8a3339b051370b9e9633e2db73b62f2714 --- Android.bp | 140 +++++++++++++++++++++++++++++++++++++++++++++-------- cargo2android.json | 6 --- cargo_embargo.json | 13 +++++ 3 files changed, 132 insertions(+), 27 deletions(-) delete mode 100644 cargo2android.json create mode 100644 cargo_embargo.json diff --git a/Android.bp b/Android.bp index ab29b5f..fb14fd3 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 { @@ -54,19 +54,21 @@ rust_library_host { "span_locations", "wrap_proc_macro", ], - rustlibs: [ - "libunicode_ident", - ], + rustlibs: ["libunicode_ident"], compile_multilib: "first", } -rust_defaults { - name: "proc-macro2_test_defaults", - crate_name: "proc_macro2", +rust_test_host { + name: "proc-macro2_test_tests_comments", + crate_name: "comments", cargo_env_compat: true, cargo_pkg_version: "1.0.69", + srcs: ["tests/comments.rs"], test_suites: ["general-tests"], auto_gen_config: true, + test_options: { + unit_test: true, + }, edition: "2021", features: [ "default", @@ -86,56 +88,152 @@ rust_defaults { proc_macros: ["librustversion"], } -rust_test_host { - name: "proc-macro2_test_tests_comments", - defaults: ["proc-macro2_test_defaults"], - srcs: ["tests/comments.rs"], - test_options: { - unit_test: true, - }, -} - rust_test_host { name: "proc-macro2_test_tests_features", - defaults: ["proc-macro2_test_defaults"], + crate_name: "features", + cargo_env_compat: true, + cargo_pkg_version: "1.0.69", srcs: ["tests/features.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2021", + features: [ + "default", + "proc-macro", + "span-locations", + ], + cfgs: [ + "proc_macro_span", + "span_locations", + "wrap_proc_macro", + ], + rustlibs: [ + "libproc_macro2", + "libquote", + "libunicode_ident", + ], + proc_macros: ["librustversion"], } rust_test_host { name: "proc-macro2_test_tests_marker", - defaults: ["proc-macro2_test_defaults"], + crate_name: "marker", + cargo_env_compat: true, + cargo_pkg_version: "1.0.69", srcs: ["tests/marker.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2021", + features: [ + "default", + "proc-macro", + "span-locations", + ], + cfgs: [ + "proc_macro_span", + "span_locations", + "wrap_proc_macro", + ], + rustlibs: [ + "libproc_macro2", + "libquote", + "libunicode_ident", + ], + proc_macros: ["librustversion"], } rust_test_host { name: "proc-macro2_test_tests_test", - defaults: ["proc-macro2_test_defaults"], + crate_name: "test", + cargo_env_compat: true, + cargo_pkg_version: "1.0.69", srcs: ["tests/test.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2021", + features: [ + "default", + "proc-macro", + "span-locations", + ], + cfgs: [ + "proc_macro_span", + "span_locations", + "wrap_proc_macro", + ], + rustlibs: [ + "libproc_macro2", + "libquote", + "libunicode_ident", + ], + proc_macros: ["librustversion"], } rust_test_host { name: "proc-macro2_test_tests_test_fmt", - defaults: ["proc-macro2_test_defaults"], + crate_name: "test_fmt", + cargo_env_compat: true, + cargo_pkg_version: "1.0.69", srcs: ["tests/test_fmt.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2021", + features: [ + "default", + "proc-macro", + "span-locations", + ], + cfgs: [ + "proc_macro_span", + "span_locations", + "wrap_proc_macro", + ], + rustlibs: [ + "libproc_macro2", + "libquote", + "libunicode_ident", + ], + proc_macros: ["librustversion"], } rust_test_host { name: "proc-macro2_test_tests_test_size", - defaults: ["proc-macro2_test_defaults"], + crate_name: "test_size", + cargo_env_compat: true, + cargo_pkg_version: "1.0.69", srcs: ["tests/test_size.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, test_options: { unit_test: true, }, + edition: "2021", + features: [ + "default", + "proc-macro", + "span-locations", + ], + cfgs: [ + "proc_macro_span", + "span_locations", + "wrap_proc_macro", + ], + rustlibs: [ + "libproc_macro2", + "libquote", + "libunicode_ident", + ], + proc_macros: ["librustversion"], } diff --git a/cargo2android.json b/cargo2android.json deleted file mode 100644 index 45a2954..0000000 --- a/cargo2android.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "features": "default,span-locations", - "host-first-multilib": 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..a64c9e4 --- /dev/null +++ b/cargo_embargo.json @@ -0,0 +1,13 @@ +{ + "features": [ + "default", + "span-locations" + ], + "package": { + "proc-macro2": { + "device_supported": false, + "host_first_multilib": true + } + }, + "tests": true +} -- cgit v1.2.3