Generate apex_available from c2a instead of a patch am: 01ff0c6d2e am: 0a44958a3e
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/memoffset/+/1688983
Change-Id: I28163a194708e5e96c9d7163539984b160d5a9d4
diff --git a/Android.bp b/Android.bp
index ae913ce..d53b9c9 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --run --device --tests --dependencies --patch=patches/Android.bp.patch.
+// This file is generated by cargo2android.py --config cargo2android.json.
// Do not modify this file as changes will be overridden on upgrade.
package {
@@ -25,11 +25,12 @@
srcs: ["src/lib.rs"],
edition: "2015",
features: ["default"],
- flags: [
- "--cfg allow_clippy",
- "--cfg doctests",
- "--cfg maybe_uninit",
- "--cfg tuple_ty",
+ cfgs: [
+ "allow_clippy",
+ "doctests",
+ "maybe_uninit",
+ "raw_ref_macros",
+ "tuple_ty",
],
apex_available: [
"//apex_available:platform",
@@ -45,11 +46,12 @@
auto_gen_config: true,
edition: "2015",
features: ["default"],
- flags: [
- "--cfg allow_clippy",
- "--cfg doctests",
- "--cfg maybe_uninit",
- "--cfg tuple_ty",
+ cfgs: [
+ "allow_clippy",
+ "doctests",
+ "maybe_uninit",
+ "raw_ref_macros",
+ "tuple_ty",
],
rustlibs: [
// ANDROID: disable for now just to avoid another dependency.
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..0f253f0
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,11 @@
+{
+ "apex-available": [
+ "//apex_available:platform",
+ "com.android.virt"
+ ],
+ "dependencies": true,
+ "device": true,
+ "patch": "patches/Android.bp.patch",
+ "run": true,
+ "tests": true
+}
\ No newline at end of file
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
index 76d4a07..96c3e12 100644
--- a/patches/Android.bp.patch
+++ b/patches/Android.bp.patch
@@ -2,18 +2,7 @@
index eb63f7c..efa8362 100644
--- a/Android.bp
+++ b/Android.bp
-@@ -13,6 +13,10 @@ rust_library {
- "--cfg maybe_uninit",
- "--cfg tuple_ty",
- ],
-+ apex_available: [
-+ "//apex_available:platform",
-+ "com.android.virt",
-+ ],
- }
-
- rust_defaults {
-@@ -30,7 +34,8 @@ rust_defaults {
+@@ -48,7 +52,8 @@ rust_defaults {
"--cfg tuple_ty",
],
rustlibs: [