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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 1006373003: Generate externs automatically from json/idl files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 0d4b264dee6615da06edc1d1c2f2eed2d518b51f..e09366b243608e861b2e036499feca2b8484531d 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -24,6 +24,7 @@ import sys
from cpp_bundle_generator import CppBundleGenerator
from cpp_generator import CppGenerator
from cpp_type_generator import CppTypeGenerator
+from js_externs_generator import JsExternsGenerator
import json_schema
from cpp_namespace_environment import CppNamespaceEnvironment
from model import Model
@@ -31,7 +32,7 @@ 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']
+GENERATORS = ['cpp', 'cpp-bundle-registration', 'cpp-bundle-schema', 'externs']
def GenerateSchema(generator_name,
file_paths,
@@ -115,6 +116,10 @@ def GenerateSchema(generator_name,
('%s.h' % filename_base, cpp_generator.h_generator),
('%s.cc' % filename_base, cpp_generator.cc_generator)
]
+ elif generator_name == 'externs':
+ generators = [
+ ('%s_externs.js' % namespace.unix_name, JsExternsGenerator())
+ ]
else:
raise Exception('Unrecognised generator %s' % generator_name)
« no previous file with comments | « no previous file | tools/json_schema_compiler/js_externs_generator.py » ('j') | tools/json_schema_compiler/js_externs_generator.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698