summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authormitchellwrosen@chromium.org <mitchellwrosen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-03 01:23:41 +0000
committermitchellwrosen@chromium.org <mitchellwrosen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-03 01:23:41 +0000
commit2f30fff337549f07694b3ed02267f5f747a587aa (patch)
treeaa374f5def402b17bde7598070bead9eab954c3d /tools
parentbc32af2b05fe0230e44b10efba8f84ac247a4e20 (diff)
downloadchromium_src-2f30fff337549f07694b3ed02267f5f747a587aa.zip
chromium_src-2f30fff337549f07694b3ed02267f5f747a587aa.tar.gz
chromium_src-2f30fff337549f07694b3ed02267f5f747a587aa.tar.bz2
Update the JSON Schema Compiler to take dependencies of the form type:name.
BUG=135224 Review URL: https://chromiumcodereview.appspot.com/10700039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145235 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/json_schema_compiler/compiler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py
index 0813ee5..ae92373 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -57,6 +57,13 @@ def handle_single_schema(filename, dest_dir, root, root_namespace):
# Load type dependencies into the model.
# TODO(miket): do we need this in IDL?
for referenced_schema in referenced_schemas:
+ split_schema = referenced_schema.split(':', 1)
+ if len(split_schema) > 1:
+ if split_schema[0] != 'api':
+ continue
+ else:
+ referenced_schema = split_schema[1]
+
referenced_schema_path = os.path.join(
os.path.dirname(schema), referenced_schema + '.json')
referenced_api_defs = json_schema.Load(referenced_schema_path)