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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 626653002: Automatically generate externs.js for a format (idl, json) supported by tools/json_schema_compiler. Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Minor changes. Created 6 years, 2 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/externs_js_generator.py » ('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 7a2e4dd6f1593ed3a4ae95b03631d3a483ffd5c0..2efaee917179ac5a5f022b5ce72c4e4f70bd0d0a 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -25,6 +25,7 @@ from cpp_bundle_generator import CppBundleGenerator
from cpp_generator import CppGenerator
from cpp_type_generator import CppTypeGenerator
from dart_generator import DartGenerator
+from externs_js_generator import ExternsJsGenerator
import json_schema
from cpp_namespace_environment import CppNamespaceEnvironment
from model import Model
@@ -32,7 +33,8 @@ from schema_loader import SchemaLoader
# Names of supported code generators, as specified on the command-line.
# First is default.
-GENERATORS = ['cpp', 'cpp-bundle-registration', 'cpp-bundle-schema', 'dart']
+GENERATORS = [
+ 'cpp', 'cpp-bundle-registration', 'cpp-bundle-schema', 'dart', 'externs-js']
def GenerateSchema(generator_name,
file_paths,
@@ -122,6 +124,8 @@ def GenerateSchema(generator_name,
('%s.dart' % namespace.unix_name, DartGenerator(
dart_overrides_dir))
]
+ elif generator_name == 'externs-js':
+ generators = [('externs.js', ExternsJsGenerator())]
else:
raise Exception('Unrecognised generator %s' % generator)
« no previous file with comments | « no previous file | tools/json_schema_compiler/externs_js_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698