cargo2android: Use cfgs property
Test: Run cargo2android on multiple crates, verify Android.bp Bug: 183727250 Change-Id: I087ffb0de33db7a09735d2e9c668d991c9f5bb49
This commit is contained in:
@@ -652,14 +652,12 @@ class Crate(object):
|
|||||||
|
|
||||||
def dump_android_flags(self):
|
def dump_android_flags(self):
|
||||||
"""Dump Android module flags property."""
|
"""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
|
return
|
||||||
self.write(' flags: [')
|
self.write(' flags: [')
|
||||||
if self.cap_lints:
|
if self.cap_lints:
|
||||||
self.write(' "--cap-lints ' + self.cap_lints + '",')
|
self.write(' "--cap-lints ' + self.cap_lints + '",')
|
||||||
cfg_fmt = '"--cfg %s"'
|
|
||||||
codegens_fmt = '"-C %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.dump_android_property_list_items(codegens_fmt, self.codegens)
|
||||||
self.write(' ],')
|
self.write(' ],')
|
||||||
|
|
||||||
@@ -667,6 +665,7 @@ class Crate(object):
|
|||||||
if self.edition:
|
if self.edition:
|
||||||
self.write(' edition: "' + self.edition + '",')
|
self.write(' edition: "' + self.edition + '",')
|
||||||
self.dump_android_property_list('features', '"%s"', self.features)
|
self.dump_android_property_list('features', '"%s"', self.features)
|
||||||
|
self.dump_android_property_list('cfgs', '"%s"', self.cfgs)
|
||||||
self.dump_android_flags()
|
self.dump_android_flags()
|
||||||
if self.externs:
|
if self.externs:
|
||||||
self.dump_android_externs()
|
self.dump_android_externs()
|
||||||
|
|||||||
Reference in New Issue
Block a user