wutingcindy / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

generators need to export RULE_INPUT_DIRNAME for use in rules' output. #200

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
take chrome_test.gypi's rule_name 'js2webui' as an example.  As it stands now, 
inputs must all be in chrome/test/data/webui.  There is, however a need to 
separate tests into subdirectories such as chrome/test/data/webui/options and 
chrome/test/data/webui/print_preview.

Since the rule_input_relpath is hard coded and there is no way of getting the 
basename of the input path (only RULE_INPUT_ROOT which is notdir - suffix, 
RULE_INPUT_PATH which is full path, RULE_INPUT_EXT which is just the suffix, 
and RULE_INPUT_NAME which is just the notdir).  Without this functionality, the 
entire rule section would have to be copied for every possible subdirectory, 
and some different suffix would be needed to route to the appropriate rule - 
not a very pretty solution.  Alternatively without separate paths/suffices, the 
generated files would go to a different relative path under 
<(SHARED_INTERMEDIATE_DIR) than the files from which they were generated.

Ideally, I'd like to change the following in chrome_tests.gypi

'outputs': [
    '<(js2webui_out_dir)/chrome/<(rule_input_relpath)/<(RULE_INPUT_ROOT)-inl.h',
],

to the following:

'outputs': [
    '<(js2webui_out_dir)/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-inl.h',
],

Original issue reported on code.google.com by s...@chromium.org on 7 Jul 2011 at 7:09

GoogleCodeExporter commented 9 years ago

Original comment by s...@chromium.org on 3 Aug 2011 at 3:52

GoogleCodeExporter commented 9 years ago

Original comment by s...@chromium.org on 13 Sep 2011 at 7:44

GoogleCodeExporter commented 9 years ago
http://codereview.chromium.org/7982014/

Original comment by s...@chromium.org on 20 Sep 2011 at 9:35

GoogleCodeExporter commented 9 years ago
Commit: cdaa7e6d2e12c7d592265333396c6d1307632e22
 Email: scr@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af

Allow gyp to support RULE_INPUT_DIRNAME so that output from rules can have a 
similar path and not risk collision.

R=bradnelson@chromium.org, evan@chromium.org 
BUG=gyp:200
Review URL: http://codereview.chromium.org/7982014

git-svn-id: http://gyp.googlecode.com/svn/trunk@1076 
78cadc50-ecff-11dd-a971-7dbc132099af

M   pylib/gyp/generator/gypd.py
M   pylib/gyp/generator/gypsh.py
M   pylib/gyp/generator/make.py
M   pylib/gyp/generator/msvs.py
M   pylib/gyp/generator/ninja.py
M   pylib/gyp/generator/scons.py
M   pylib/gyp/generator/xcode.py
M   test/rules/src/actions.gyp

Original comment by bugdroid1@chromium.org on 18 Oct 2011 at 4:47

GoogleCodeExporter commented 9 years ago
Commit: ffab077e42f125868f8e048b023bf2da39fd8876
 Email: scr@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af

Allow gyp to support RULE_INPUT_DIRNAME so that output from rules can have a 
similar path and not risk collision.

R=bradnelson@chromium.org, evan@chromium.org 
BUG=gyp:200
Review URL: http://codereview.chromium.org/7982014

git-svn-id: http://gyp.googlecode.com/svn/trunk@1077 
78cadc50-ecff-11dd-a971-7dbc132099af

A   test/rules-dirname/gyptest-dirname.py
A   test/rules-dirname/src/actions.gyp
A   test/rules-dirname/src/copy-file.py
A   test/rules-dirname/src/subdir/a/b/c.gencc
A   test/rules-dirname/src/subdir/a/b/c.printvars
A   test/rules-dirname/src/subdir/foo/bar/baz.gencc
A   test/rules-dirname/src/subdir/foo/bar/baz.printvars
A   test/rules-dirname/src/subdir/input-rule-dirname.gyp
A   test/rules-dirname/src/subdir/main.cc
A   test/rules-dirname/src/subdir/printvars.py

Original comment by bugdroid1@chromium.org on 18 Oct 2011 at 5:07

GoogleCodeExporter commented 9 years ago

Original comment by s...@chromium.org on 18 Oct 2011 at 5:11

GoogleCodeExporter commented 9 years ago

Original comment by s...@chromium.org on 2 Nov 2011 at 6:08