cargo2android: Use cfgs property
Test: Run cargo2android on multiple crates, verify Android.bp
Bug: 183727250
Change-Id: I087ffb0de33db7a09735d2e9c668d991c9f5bb49
diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py
index 620988e..2da6dcb 100755
--- a/scripts/cargo2android.py
+++ b/scripts/cargo2android.py
@@ -652,14 +652,12 @@
def dump_android_flags(self):
"""Dump Android module flags property."""
- if not self.cfgs and not self.codegens and not self.cap_lints:
+ if not self.codegens and not self.cap_lints:
return
self.write(' flags: [')
if self.cap_lints:
self.write(' "--cap-lints ' + self.cap_lints + '",')
- cfg_fmt = '"--cfg %s"'
codegens_fmt = '"-C %s"'
- self.dump_android_property_list_items(cfg_fmt, self.cfgs)
self.dump_android_property_list_items(codegens_fmt, self.codegens)
self.write(' ],')
@@ -667,6 +665,7 @@
if self.edition:
self.write(' edition: "' + self.edition + '",')
self.dump_android_property_list('features', '"%s"', self.features)
+ self.dump_android_property_list('cfgs', '"%s"', self.cfgs)
self.dump_android_flags()
if self.externs:
self.dump_android_externs()