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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 511943003: Generate externs automatically from json/idl files: minor changes. Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: Created 6 years, 4 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
Index: tools/json_schema_compiler/compiler.py
diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py
index 38899286d215158c7701ff7cda84285f927e0f01..0b33431de0fe6b16926254ccf301cddb87605ea8 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -24,13 +24,15 @@ 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
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']
def GenerateSchema(generator_name,
file_paths,
@@ -115,8 +117,12 @@ def GenerateSchema(generator_name,
('%s.dart' % namespace.unix_name, DartGenerator(
dart_overrides_dir))
]
+ elif generator_name == 'externs':
+ generators = [
+ ('%s_externs.js' % namespace.unix_name, JsExternsGenerator())
+ ]
else:
- raise Exception('Unrecognised generator %s' % generator)
+ raise Exception('Unrecognised generator %s' % generator_name)
output_code = []
for filename, generator in generators:
« no previous file with comments | « no previous file | tools/json_schema_compiler/create_externs.sh » ('j') | tools/json_schema_compiler/create_externs.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698