Index: build/json_schema_compile.gypi |
diff --git a/build/json_schema_compile.gypi b/build/json_schema_compile.gypi |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9d47ebb8dab58634115fe118547b3243bf00b171 |
--- /dev/null |
+++ b/build/json_schema_compile.gypi |
@@ -0,0 +1,55 @@ |
+# Copyright (c) 2011 The Chromium Authors. All rights reserved. |
Aaron Boodman
2012/01/19 23:31:13
I know next to nothing about gyp, so I'm going to
|
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+{ |
+ 'variables': { |
+ 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', |
+ 'api_gen': '<(api_gen_dir)/compiler.py', |
+ }, |
+ 'rules': [ |
Nico
2012/01/18 17:30:12
It looks like this rule requires a few variables t
calamity
2012/01/18 23:46:18
Yeah, using <(SHARED_INTERMEDIATE_DIR) instead of
Nico
2012/01/18 23:54:42
Does RULE_INPUT_DIRNAME work?
calamity
2012/01/19 00:29:59
I've looked at the tests for RULE_INPUT_DIRNAME an
Nico
2012/01/19 00:49:46
Might be a bug in gyp.
Taking a step back: What d
calamity
2012/01/19 00:57:07
When I use INTERMEDIATE_DIR, the generated files a
|
+ { |
+ 'rule_name': 'genapi', |
+ 'extension': 'json', |
+ 'inputs': [ |
+ '<(api_gen_dir)/code.py', |
+ '<(api_gen_dir)/compiler.py', |
+ '<(api_gen_dir)/model.py', |
+ '<(api_gen_dir)/cc_generator.py', |
+ '<(api_gen_dir)/h_generator.py', |
+ '<(api_gen_dir)/cpp_type_generator.py', |
+ '<@(json_schema_files)', |
+ ], |
+ 'outputs': [ |
+ '<(cc_dir)/<(RULE_INPUT_ROOT)_api.cc', |
+ '<(cc_dir)/<(RULE_INPUT_ROOT)_api.h', |
+ ], |
+ 'action': [ |
+ 'python', |
+ '<(api_gen)', |
+ '<(RULE_INPUT_PATH)', |
+ '--root=<(DEPTH)', |
+ '--destdir=<(cc_root)', |
+ '--namespace=<(root_namespace)', |
+ '<@(json_schema_files)', |
Nico
2012/01/18 17:30:12
Why do you need to pass in both <(RULE_INPUT_PATH)
calamity
2012/01/18 23:46:18
This was a bit of a hack. Each json could have ref
Nico
2012/01/18 23:54:42
I see. And you can't just put the dependencies bet
|
+ ], |
+ 'message': 'Generating C++ code from <(RULE_INPUT_PATH) jsons', |
+ 'process_outputs_as_sources': 1, |
+ }, |
+ ], |
+ 'include_dirs': [ |
+ '<(cc_root)', |
+ '<(DEPTH)', |
+ ], |
+ 'dependencies':[ |
+ '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util', |
+ ], |
+ 'direct_dependent_settings': { |
+ 'include_dirs': [ |
+ '<(cc_root)', |
+ ] |
+ }, |
+ # This target exports a hard dependency because it generates header |
+ # files. |
+ 'hard_dependency': 1, |
+} |