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

Side by Side Diff: tools/gn/function_rebase_path.cc

Issue 892043004: gn: Do not advertise a rebase_path() command with more than 3 parameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/build_settings.h" 5 #include "tools/gn/build_settings.h"
6 #include "tools/gn/filesystem_utils.h" 6 #include "tools/gn/filesystem_utils.h"
7 #include "tools/gn/functions.h" 7 #include "tools/gn/functions.h"
8 #include "tools/gn/parse_tree.h" 8 #include "tools/gn/parse_tree.h"
9 #include "tools/gn/scope.h" 9 #include "tools/gn/scope.h"
10 #include "tools/gn/settings.h" 10 #include "tools/gn/settings.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 " # Convert a file in the current directory to be relative to the build\n" 178 " # Convert a file in the current directory to be relative to the build\n"
179 " # directory (the current dir when executing compilers and scripts).\n" 179 " # directory (the current dir when executing compilers and scripts).\n"
180 " foo = rebase_path(\"myfile.txt\", root_build_dir)\n" 180 " foo = rebase_path(\"myfile.txt\", root_build_dir)\n"
181 " # might produce \"../../project/myfile.txt\".\n" 181 " # might produce \"../../project/myfile.txt\".\n"
182 "\n" 182 "\n"
183 " # Convert a file to be system absolute:\n" 183 " # Convert a file to be system absolute:\n"
184 " foo = rebase_path(\"myfile.txt\")\n" 184 " foo = rebase_path(\"myfile.txt\")\n"
185 " # Might produce \"D:\\source\\project\\myfile.txt\" on Windows or\n" 185 " # Might produce \"D:\\source\\project\\myfile.txt\" on Windows or\n"
186 " # \"/home/you/source/project/myfile.txt\" on Linux.\n" 186 " # \"/home/you/source/project/myfile.txt\" on Linux.\n"
187 "\n" 187 "\n"
188 " # Convert a file's path separators from forward slashes to system\n"
189 " # slashes.\n"
190 " foo = rebase_path(\"source/myfile.txt\", \".\", \".\", \"to_system\")\n"
191 "\n"
192 " # Typical usage for converting to the build directory for a script.\n" 188 " # Typical usage for converting to the build directory for a script.\n"
193 " action(\"myscript\") {\n" 189 " action(\"myscript\") {\n"
194 " # Don't convert sources, GN will automatically convert these to be\n" 190 " # Don't convert sources, GN will automatically convert these to be\n"
195 " # relative to the build directory when it contructs the command\n" 191 " # relative to the build directory when it contructs the command\n"
196 " # line for your script.\n" 192 " # line for your script.\n"
197 " sources = [ \"foo.txt\", \"bar.txt\" ]\n" 193 " sources = [ \"foo.txt\", \"bar.txt\" ]\n"
198 "\n" 194 "\n"
199 " # Extra file args passed manually need to be explicitly converted\n" 195 " # Extra file args passed manually need to be explicitly converted\n"
200 " # to be relative to the build directory:\n" 196 " # to be relative to the build directory:\n"
201 " args = [\n" 197 " args = [\n"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 268 }
273 return result; 269 return result;
274 } 270 }
275 271
276 *err = Err(function->function(), 272 *err = Err(function->function(),
277 "rebase_path requires a list or a string."); 273 "rebase_path requires a list or a string.");
278 return result; 274 return result;
279 } 275 }
280 276
281 } // namespace functions 277 } // namespace functions
OLDNEW
« 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