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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 15677003: Generate externs automatically from json/idl files. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years, 7 months 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
« no previous file with comments | « no previous file | tools/json_schema_compiler/create_externs.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/compiler.py
diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py
index acf64acd91d0226ab2959ba1faef20b12c75722e..4fee004505528852742072847d03da43eec245f0 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -24,13 +24,14 @@ from cpp_bundle_generator import CppBundleGenerator
from cpp_generator import CppGenerator
from cpp_type_generator import CppTypeGenerator
from dart_generator import DartGenerator
+from js_externs_generator import JsExternsGenerator
import json_schema
from model import Model, UnixName
from schema_loader import SchemaLoader
# Names of supported code generators, as specified on the command-line.
# First is default.
-GENERATORS = ['cpp', 'cpp-bundle', 'dart']
+GENERATORS = ['cpp', 'cpp-bundle', 'dart', 'externs']
def GenerateSchema(generator,
filenames,
@@ -110,6 +111,10 @@ def GenerateSchema(generator,
('%s.dart' % namespace.unix_name, DartGenerator(
dart_overrides_dir))
]
+ elif generator == 'externs':
+ generators = [
+ ('%s_externs.js' % namespace.unix_name, JsExternsGenerator())
+ ]
else:
raise Exception('Unrecognised generator %s' % generator)
« no previous file with comments | « no previous file | tools/json_schema_compiler/create_externs.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698