|
Refactor GN source expansions.
This is in preparation for using {{patterns}} in toolchain definitions. It makes them
more generic and usable for this, without actually implementing any new features or
changing behavior. The only external change should be that the $in variable is used for
actions instead of making a redundant new variable (used to be called $source).
It removes the FileTemplate class and explodes it into several files: the type list and
helpers (substitution_type), a single pattern (substitution_pattern), a list of patterns
(substitution_list), and a class of helper functions for processing templates in various
ways (substitution_writer).
Previously, the things needing substitutions (args, outputs, depfile) were stored as
strings and parsed in to FileTemplates as needed. This new method stores the
SubstitutionList/Pattern directly on the target. This allows it to issue parse errors
(previously such errors were ignored since errors weren't reportable when writing Ninja
files) and cleans up a lot of the code that uses it.
R=scottmg@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287847
Total comments: 14
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1484 lines, -1117 lines) |
Patch |
 |
M |
base/BUILD.gn
|
View
|
1
2
3
4
5
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
tools/gn/BUILD.gn
|
View
|
1
2
3
4
5
|
4 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
 |
M |
tools/gn/action_target_generator.cc
|
View
|
1
2
3
4
5
|
6 chunks |
+14 lines, -26 lines |
0 comments
|
Download
|
 |
A |
tools/gn/action_target_generator_unittest.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+42 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tools/gn/action_values.h
|
View
|
1
|
2 chunks |
+11 lines, -10 lines |
0 comments
|
Download
|
 |
M |
tools/gn/command_desc.cc
|
View
|
1
2
3
4
5
|
4 chunks |
+34 lines, -44 lines |
0 comments
|
Download
|
 |
M |
tools/gn/command_help.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
tools/gn/copy_target_generator.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
tools/gn/escape.cc
|
View
|
1
2
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
D |
tools/gn/file_template.h
|
View
|
|
1 chunk |
+0 lines, -177 lines |
0 comments
|
Download
|
 |
D |
tools/gn/file_template.cc
|
View
|
|
1 chunk |
+0 lines, -419 lines |
0 comments
|
Download
|
 |
D |
tools/gn/file_template_unittest.cc
|
View
|
|
1 chunk |
+0 lines, -183 lines |
0 comments
|
Download
|
 |
M |
tools/gn/filesystem_utils.h
|
View
|
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
 |
M |
tools/gn/filesystem_utils.cc
|
View
|
|
3 chunks |
+0 lines, -10 lines |
0 comments
|
Download
|
 |
M |
tools/gn/filesystem_utils_unittest.cc
|
View
|
1
2
|
1 chunk |
+5 lines, -22 lines |
0 comments
|
Download
|
 |
M |
tools/gn/function_get_target_outputs.cc
|
View
|
1
2
|
4 chunks |
+17 lines, -22 lines |
0 comments
|
Download
|
 |
M |
tools/gn/function_get_target_outputs_unittest.cc
|
View
|
1
2
|
3 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
 |
M |
tools/gn/function_process_file_template.cc
|
View
|
|
2 chunks |
+15 lines, -15 lines |
0 comments
|
Download
|
 |
M |
tools/gn/function_write_file.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
tools/gn/gn.gyp
|
View
|
1
2
3
4
5
|
4 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
 |
M |
tools/gn/ninja_action_target_writer.h
|
View
|
1
2
|
4 chunks |
+2 lines, -13 lines |
0 comments
|
Download
|
 |
M |
tools/gn/ninja_action_target_writer.cc
|
View
|
1
2
|
10 chunks |
+45 lines, -60 lines |
0 comments
|
Download
|
 |
M |
tools/gn/ninja_action_target_writer_unittest.cc
|
View
|
1
2
|
12 chunks |
+26 lines, -63 lines |
0 comments
|
Download
|
 |
M |
tools/gn/ninja_copy_target_writer.cc
|
View
|
1
2
|
3 chunks |
+11 lines, -13 lines |
0 comments
|
Download
|
 |
M |
tools/gn/ninja_copy_target_writer_unittest.cc
|
View
|
1
2
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
tools/gn/ninja_target_writer.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
tools/gn/source_file.h
|
View
|
1
2
3
4
5
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tools/gn/source_file.cc
|
View
|
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_list.h
|
View
|
1
2
|
1 chunk |
+46 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_list.cc
|
View
|
1
2
|
1 chunk |
+72 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_pattern.h
|
View
|
1
2
|
1 chunk |
+61 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_pattern.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+111 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_pattern_unittest.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+49 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_type.h
|
View
|
1
|
1 chunk |
+87 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_type.cc
|
View
|
1
2
|
1 chunk |
+149 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_writer.h
|
View
|
|
1 chunk |
+107 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_writer.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+317 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/gn/substitution_writer_unittest.cc
|
View
|
|
1 chunk |
+152 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tools/gn/target_generator.h
|
View
|
1
2
3
4
5
|
1 chunk |
+8 lines, -1 line |
0 comments
|
Download
|
 |
M |
tools/gn/target_generator.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+53 lines, -9 lines |
0 comments
|
Download
|
Total messages: 5 (0 generated)
|