Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: mojo/public/tools/bindings/mojom_list_outputs.py

Issue 1517043004: [mojo] Add typemap and variant support to generators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pickle3
Patch Set: set proper upstream Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/mojom_list_outputs.py
diff --git a/mojo/public/tools/bindings/mojom_list_outputs.py b/mojo/public/tools/bindings/mojom_list_outputs.py
index ed8bdfa5b34de5512215ed31771cfe9b7d2ad985..267bd8063476a52cd86b7b76b10842caa09e950e 100755
--- a/mojo/public/tools/bindings/mojom_list_outputs.py
+++ b/mojo/public/tools/bindings/mojom_list_outputs.py
@@ -11,20 +11,32 @@ def main():
parser = argparse.ArgumentParser(
description="GYP helper script for mapping mojoms => generated outputs.")
parser.add_argument("--basedir", required=True)
+ parser.add_argument("--variant", required=True)
parser.add_argument("mojom", nargs="*")
args = parser.parse_args()
+ variant = args.variant if args.variant != "none" else None
+
for mojom in args.mojom:
full = os.path.join("<(SHARED_INTERMEDIATE_DIR)", args.basedir, mojom)
base, ext = os.path.splitext(full)
- assert ext == ".mojom", mojom
+
+ # Ignore non-mojom files.
+ if ext != ".mojom":
+ continue
+
# Fix filename escaping issues on Windows.
base = base.replace("\\", "/")
- print base + ".mojom.cc"
- print base + ".mojom.h"
- print base + ".mojom-internal.h"
- print base + ".mojom.js"
+ if variant:
+ print base + ".mojom-%s.cc" % variant
+ print base + ".mojom-%s.h" % variant
+ print base + ".mojom-%s-internal.h" % variant
+ else:
+ print base + ".mojom.cc"
+ print base + ".mojom.h"
+ print base + ".mojom-internal.h"
+ print base + ".mojom.js"
return 0
« no previous file with comments | « mojo/public/tools/bindings/mojom_bindings_generator.py ('k') | mojo/public/tools/bindings/pylib/mojom/generate/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698