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

Unified Diff: build/secondary/tools/grit/grit_rule.gni

Issue 1005763003: Allow for GN Grit targets to depend on a stamp file instead of the first output in the .grd file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/secondary/tools/grit/grit_rule.gni
diff --git a/build/secondary/tools/grit/grit_rule.gni b/build/secondary/tools/grit/grit_rule.gni
index 626fd745d8a9dc505b59cd4a10ad7951de1def18..777c3dc104d95075aa08c9fcee6c0caf8d8bfd20 100644
--- a/build/secondary/tools/grit/grit_rule.gni
+++ b/build/secondary/tools/grit/grit_rule.gni
@@ -364,8 +364,21 @@ template("grit") {
action(grit_custom_target) {
script = "//tools/grit/grit.py"
inputs = grit_inputs
- outputs = grit_outputs
- depfile = "$output_dir/${grit_output_name}.d"
+
+ # TODO(knn): Remove this once grit has rolled to recognize the flag.
+ depend_on_stamp =
+ defined(invoker.depend_on_stamp) && invoker.depend_on_stamp
+ if (depend_on_stamp) {
+ # Need this for migrating existing targets without clobbering.
+ depfile = "$output_dir/${grit_output_name}_stamp.d"
+ outputs = [
+ "${depfile}.stamp",
+ ]
+ } else {
+ depfile = "$output_dir/${grit_output_name}.d"
+ outputs = []
+ }
+ outputs += grit_outputs
args = [
"-i",
@@ -379,14 +392,18 @@ template("grit") {
]
}
args += [
- "-o",
- rebased_output_dir,
- "--depdir",
- ".",
- "--depfile",
- rebase_path(depfile, root_build_dir),
- "--write-only-new=1",
- ] + grit_defines
+ "-o",
+ rebased_output_dir,
+ "--depdir",
+ ".",
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--write-only-new=1",
+ ]
+ if (depend_on_stamp) {
+ args += [ "--depend-on-stamp" ]
+ }
+ args += grit_defines
# Add extra defines with -D flags.
if (defined(invoker.defines)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698