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

Unified Diff: tools/gn/docs/cookbook.md

Issue 1683123002: Mention how to convert "copies" from gyp to gn in the cookbook. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NEWLINE Created 4 years, 10 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: tools/gn/docs/cookbook.md
diff --git a/tools/gn/docs/cookbook.md b/tools/gn/docs/cookbook.md
index c918d86448b74c8883ec35d7241d7599c66e9265..c32856349a1e32db3feed0c906e5cbbd589f2b10 100644
--- a/tools/gn/docs/cookbook.md
+++ b/tools/gn/docs/cookbook.md
@@ -64,7 +64,7 @@ action("foo") {
args = [ "--la_dee_da" ]
}
-executable('foo.exe') {
+executable("foo.exe") {
...
deps = [ ":foo" ] # Depend on the action to make sure it runs.
}
@@ -73,6 +73,36 @@ executable('foo.exe') {
Rules in GYP become `action_foreach` in GN which work like actions but
iterate over a set of sources.
+### Copies
+
+GYP
+
+```
+'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/',
+ 'files': [
+ '../build/win/dbghelp_xp/dbghelp.dll',
+ ],
+ },
+],
+```
+
+Unlike GYP, where copies are part of a target, GN copies are
+separate targets that you then depend on via deps from other targets:
+
+```
+copy("bar") {
+ sources = [ "../path/to/secret.dll" ]
+ outputs = [ "$root_out_dir/{{source_file_part}}" ]
+}
+
+component("base") {
+ ...
+ deps = [ "bar" } # Depend on the copy to make sure it runs.
+}
+```
+
## Platform checking
| *GYP* | *GN* |
« 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