style: Generate property list from Servo data.

Bug: 1452542
Reviewed-by: emilio,froydnj
MozReview-Commit-ID: CwK2oL88r6F
This commit is contained in:
Xidorn Quan 2018-04-16 14:08:20 +10:00 committed by Emilio Cobos Álvarez
parent 2cd06807fa
commit 78f9672b6c
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 8 additions and 1 deletions

View file

@ -21,7 +21,7 @@ RE_PYTHON_ADDR = re.compile(r'<.+? object at 0x[0-9a-fA-F]+>')
def main():
usage = "Usage: %s [ servo | gecko ] [ style-crate | html ]" % sys.argv[0]
usage = "Usage: %s [ servo | gecko ] [ style-crate | geckolib <template> | html ]" % sys.argv[0]
if len(sys.argv) < 3:
abort(usage)
product = sys.argv[1]
@ -39,6 +39,12 @@ def main():
template = os.path.join(BASE, "gecko.mako.rs")
rust = render(template, data=properties)
write(os.environ["OUT_DIR"], "gecko_properties.rs", rust)
elif output == "geckolib":
if len(sys.argv) < 4:
abort(usage)
template = sys.argv[3]
header = render(template, data=properties)
sys.stdout.write(header)
elif output == "html":
write_html(properties)

View file

@ -385,6 +385,7 @@ class Alias(object):
self.name = name
self.ident = to_rust_ident(name)
self.camel_case = to_camel_case(self.ident)
self.original = original
self.enabled_in = original.enabled_in
self.servo_pref = original.servo_pref
self.gecko_pref = gecko_pref