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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 10272021: Files generated by the JSON schema compiler are named incorrectly (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Check to make files are named correctly Created 8 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 | « tools/json_schema_compiler/cc_generator.py ('k') | tools/json_schema_compiler/cpp_type_generator_test.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 1d0884152e057200c1ca8f54e65cd6594960060b..3b51d289ef944b9252adac14e585eaa35c9386e8 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -68,9 +68,14 @@ def handle_single_schema(filename, dest_dir, root, root_namespace):
if not namespace:
continue
+ path, schema_filename = os.path.split(schema_filename)
+ if schema_filename != namespace.unix_name:
+ sys.exit("Filename %s%s is illegal. Name files using unix_hacker style." %
+ (schema_filename, schema_extension))
+
# The output filename must match the input filename for gyp to deal with it
# properly.
- out_file = namespace.name
+ out_file = namespace.unix_name
type_generator = cpp_type_generator.CppTypeGenerator(
root_namespace, namespace, namespace.unix_name)
for referenced_namespace in api_model.namespaces.values():
@@ -78,7 +83,7 @@ def handle_single_schema(filename, dest_dir, root, root_namespace):
continue
type_generator.AddNamespace(
referenced_namespace,
- referenced_namespace.name)
+ referenced_namespace.unix_name)
h_code = (h_generator.HGenerator(namespace, type_generator)
.Generate().Render())
@@ -120,7 +125,7 @@ def handle_bundle_schema(filenames, dest_dir, root, root_namespace):
for referenced_namespace in api_model.namespaces.values():
type_generator.AddNamespace(
referenced_namespace,
- referenced_namespace.name)
+ referenced_namespace.unix_name)
generator = schema_bundle_generator.SchemaBundleGenerator(
api_model, api_defs, type_generator)
« no previous file with comments | « tools/json_schema_compiler/cc_generator.py ('k') | tools/json_schema_compiler/cpp_type_generator_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698