 Chromium Code Reviews
 Chromium Code Reviews Issue 9114036:
  Code generation for extensions api  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@master
    
  
    Issue 9114036:
  Code generation for extensions api  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@master| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 # 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
 | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 { | |
| 6 'variables': { | |
| 7 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', | |
| 8 'api_gen': '<(api_gen_dir)/compiler.py', | |
| 9 }, | |
| 10 '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
 | |
| 11 { | |
| 12 'rule_name': 'genapi', | |
| 13 'extension': 'json', | |
| 14 'inputs': [ | |
| 15 '<(api_gen_dir)/code.py', | |
| 16 '<(api_gen_dir)/compiler.py', | |
| 17 '<(api_gen_dir)/model.py', | |
| 18 '<(api_gen_dir)/cc_generator.py', | |
| 19 '<(api_gen_dir)/h_generator.py', | |
| 20 '<(api_gen_dir)/cpp_type_generator.py', | |
| 21 '<@(json_schema_files)', | |
| 22 ], | |
| 23 'outputs': [ | |
| 24 '<(cc_dir)/<(RULE_INPUT_ROOT)_api.cc', | |
| 25 '<(cc_dir)/<(RULE_INPUT_ROOT)_api.h', | |
| 26 ], | |
| 27 'action': [ | |
| 28 'python', | |
| 29 '<(api_gen)', | |
| 30 '<(RULE_INPUT_PATH)', | |
| 31 '--root=<(DEPTH)', | |
| 32 '--destdir=<(cc_root)', | |
| 33 '--namespace=<(root_namespace)', | |
| 34 '<@(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
 | |
| 35 ], | |
| 36 'message': 'Generating C++ code from <(RULE_INPUT_PATH) jsons', | |
| 37 'process_outputs_as_sources': 1, | |
| 38 }, | |
| 39 ], | |
| 40 'include_dirs': [ | |
| 41 '<(cc_root)', | |
| 42 '<(DEPTH)', | |
| 43 ], | |
| 44 'dependencies':[ | |
| 45 '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util', | |
| 46 ], | |
| 47 'direct_dependent_settings': { | |
| 48 'include_dirs': [ | |
| 49 '<(cc_root)', | |
| 50 ] | |
| 51 }, | |
| 52 # This target exports a hard dependency because it generates header | |
| 53 # files. | |
| 54 'hard_dependency': 1, | |
| 55 } | |
| OLD | NEW |