Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Issue 440333002: Support more configurability in GN toolchains (Closed)

Created:
6 years, 4 months ago by brettw
Modified:
6 years, 4 months ago
Reviewers:
jamesr
CC:
chromium-reviews, tfarina
Project:
chromium
Visibility:
Public.

Description

Support more configurability in GN toolchains This uses substitution patterns in toolchains to allow the toolchain to specify more flexibly how files are to be named and generated at each step. The toolchain now has control over the naming of object and executable files, for example, where before these were hardcoded. This removes most of the OS-specific logic hardcoded into the GN tool. There is still a bunch in action invocation; this will be done in a followup. R=jamesr@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=290685

Patch Set 1 #

Patch Set 2 : merge #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : binary writer tests pass #

Patch Set 6 : buidler unittests working #

Patch Set 7 : basic example workin #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 24

Patch Set 10 : fix windows deps #

Patch Set 11 : REview comments #

Patch Set 12 : unsigned check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3233 lines, -1378 lines) Patch
M tools/gn/BUILD.gn View 1 2 3 4 5 6 7 5 chunks +8 lines, -3 lines 0 comments Download
M tools/gn/builder.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/builder.cc View 1 2 3 4 2 chunks +20 lines, -1 line 0 comments Download
M tools/gn/builder_unittest.cc View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M tools/gn/command_gen.cc View 1 2 3 5 chunks +3 lines, -8 lines 0 comments Download
M tools/gn/config_values_extractors_unittest.cc View 1 2 3 4 5 6 3 chunks +3 lines, -0 lines 0 comments Download
M tools/gn/escape.h View 1 2 3 4 5 6 7 1 chunk +9 lines, -1 line 0 comments Download
M tools/gn/escape.cc View 1 2 3 4 5 6 2 chunks +14 lines, -0 lines 0 comments Download
M tools/gn/escape_unittest.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
A tools/gn/example/.gn View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
A tools/gn/example/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +28 lines, -0 lines 0 comments Download
A tools/gn/example/README.txt View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
A tools/gn/example/build/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +19 lines, -0 lines 0 comments Download
A tools/gn/example/build/BUILDCONFIG.gn View 1 2 3 4 5 6 7 1 chunk +26 lines, -0 lines 0 comments Download
A tools/gn/example/build/toolchain/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +78 lines, -0 lines 0 comments Download
A tools/gn/example/hello.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
A tools/gn/example/hello_shared.h View 1 2 3 4 5 6 7 1 chunk +32 lines, -0 lines 0 comments Download
A + tools/gn/example/hello_shared.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -5 lines 0 comments Download
A + tools/gn/example/hello_static.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -5 lines 0 comments Download
A + tools/gn/example/hello_static.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -5 lines 0 comments Download
M tools/gn/filesystem_utils.h View 1 2 3 4 3 chunks +17 lines, -19 lines 0 comments Download
M tools/gn/filesystem_utils.cc View 1 2 3 4 6 chunks +48 lines, -56 lines 0 comments Download
M tools/gn/filesystem_utils_unittest.cc View 1 2 3 4 6 chunks +99 lines, -18 lines 0 comments Download
M tools/gn/function_get_target_outputs.cc View 1 2 3 4 4 chunks +23 lines, -52 lines 0 comments Download
M tools/gn/function_get_target_outputs_unittest.cc View 1 2 3 4 5 6 1 chunk +0 lines, -24 lines 0 comments Download
M tools/gn/function_rebase_path.cc View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M tools/gn/function_toolchain.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +574 lines, -85 lines 0 comments Download
M tools/gn/function_write_file.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/gn.gyp View 1 2 3 4 5 6 7 5 chunks +8 lines, -3 lines 0 comments Download
M tools/gn/header_checker.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tools/gn/ninja_action_target_writer.h View 1 2 3 3 chunks +1 line, -9 lines 0 comments Download
M tools/gn/ninja_action_target_writer.cc View 1 2 3 5 chunks +11 lines, -34 lines 0 comments Download
M tools/gn/ninja_action_target_writer_unittest.cc View 1 2 3 14 chunks +33 lines, -10 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.h View 1 2 3 4 3 chunks +28 lines, -14 lines 0 comments Download
M tools/gn/ninja_binary_target_writer.cc View 1 2 3 4 5 6 7 12 chunks +177 lines, -212 lines 0 comments Download
M tools/gn/ninja_binary_target_writer_unittest.cc View 1 2 3 4 4 chunks +63 lines, -80 lines 0 comments Download
M tools/gn/ninja_build_writer.h View 1 2 2 chunks +0 lines, -3 lines 0 comments Download
M tools/gn/ninja_build_writer.cc View 1 2 3 5 chunks +5 lines, -6 lines 0 comments Download
M tools/gn/ninja_copy_target_writer.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -3 lines 0 comments Download
M tools/gn/ninja_copy_target_writer.cc View 1 2 3 4 5 6 7 3 chunks +48 lines, -17 lines 0 comments Download
M tools/gn/ninja_copy_target_writer_unittest.cc View 1 2 3 4 chunks +11 lines, -2 lines 0 comments Download
M tools/gn/ninja_group_target_writer.h View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M tools/gn/ninja_group_target_writer.cc View 1 2 3 2 chunks +12 lines, -18 lines 0 comments Download
M tools/gn/ninja_helper.h View 1 2 1 chunk +0 lines, -81 lines 0 comments Download
M tools/gn/ninja_helper.cc View 1 2 1 chunk +0 lines, -240 lines 0 comments Download
D tools/gn/ninja_helper_unittest.cc View 1 2 1 chunk +0 lines, -99 lines 0 comments Download
M tools/gn/ninja_target_writer.h View 1 2 3 3 chunks +14 lines, -8 lines 0 comments Download
M tools/gn/ninja_target_writer.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +127 lines, -30 lines 0 comments Download
M tools/gn/ninja_target_writer_unittest.cc View 1 2 3 4 5 6 5 chunks +9 lines, -1 line 0 comments Download
M tools/gn/ninja_toolchain_writer.h View 1 2 3 4 5 6 7 4 chunks +12 lines, -4 lines 0 comments Download
M tools/gn/ninja_toolchain_writer.cc View 1 2 3 4 5 6 7 8 9 4 chunks +61 lines, -32 lines 0 comments Download
A tools/gn/ninja_toolchain_writer_unittest.cc View 1 2 3 4 5 6 7 1 chunk +31 lines, -0 lines 0 comments Download
A tools/gn/ninja_utils.h View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download
A tools/gn/ninja_utils.cc View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download
M tools/gn/output_file.h View 1 2 3 4 1 chunk +11 lines, -8 lines 0 comments Download
A tools/gn/output_file.cc View 1 2 3 4 1 chunk +39 lines, -0 lines 0 comments Download
M tools/gn/path_output.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M tools/gn/path_output.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
A tools/gn/source_file_type.h View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
A tools/gn/source_file_type.cc View 1 2 1 chunk +31 lines, -0 lines 0 comments Download
M tools/gn/string_utils.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M tools/gn/string_utils.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M tools/gn/substitution_list.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M tools/gn/substitution_list.cc View 1 2 3 chunks +8 lines, -11 lines 0 comments Download
M tools/gn/substitution_pattern.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +13 lines, -1 line 0 comments Download
M tools/gn/substitution_pattern.cc View 1 2 3 4 4 chunks +39 lines, -11 lines 0 comments Download
M tools/gn/substitution_type.h View 1 2 3 4 5 6 4 chunks +25 lines, -2 lines 0 comments Download
M tools/gn/substitution_type.cc View 1 2 3 4 5 6 9 chunks +45 lines, -11 lines 0 comments Download
M tools/gn/substitution_writer.h View 1 2 3 4 5 chunks +103 lines, -10 lines 0 comments Download
M tools/gn/substitution_writer.cc View 1 2 3 4 5 7 chunks +281 lines, -42 lines 0 comments Download
M tools/gn/substitution_writer_unittest.cc View 1 2 3 4 5 3 chunks +108 lines, -3 lines 0 comments Download
M tools/gn/target.h View 1 2 3 4 5 chunks +52 lines, -0 lines 0 comments Download
M tools/gn/target.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +116 lines, -1 line 0 comments Download
M tools/gn/target_generator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/target_unittest.cc View 1 2 3 4 9 chunks +106 lines, -50 lines 0 comments Download
M tools/gn/test_with_scope.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M tools/gn/test_with_scope.cc View 1 2 3 4 5 6 7 2 chunks +100 lines, -0 lines 0 comments Download
A tools/gn/tool.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +197 lines, -0 lines 0 comments Download
A tools/gn/tool.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +28 lines, -0 lines 0 comments Download
M tools/gn/toolchain.h View 1 2 3 4 5 6 7 8 9 10 5 chunks +37 lines, -20 lines 0 comments Download
M tools/gn/toolchain.cc View 1 2 3 4 5 6 7 3 chunks +81 lines, -11 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
brettw
HOW TO REVIEW: 1. Read the documentation in function_toolchain.cc. and look at the example toolchain ...
6 years, 4 months ago (2014-08-19 16:44:51 UTC) #1
jamesr
lgtm When are you using CHECK vs DCHECK? It doesn't seem super obvious to me ...
6 years, 4 months ago (2014-08-19 19:30:42 UTC) #2
brettw
New snap up if you care. https://codereview.chromium.org/440333002/diff/160001/tools/gn/escape.cc File tools/gn/escape.cc (right): https://codereview.chromium.org/440333002/diff/160001/tools/gn/escape.cc#newcode57 tools/gn/escape.cc:57: dest->push_back('$'); On 2014/08/19 ...
6 years, 4 months ago (2014-08-19 21:29:57 UTC) #3
brettw
6 years, 4 months ago (2014-08-19 22:52:23 UTC) #4
Message was sent while issue was closed.
Committed patchset #12 manually as 290685 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698