Chromium Code Reviews| Index: tools/gn/function_toolchain.cc |
| diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc |
| index 9eeae982cf3bf17210ef53e4325d23b69c7f98a1..3070df58647ff1504728b2892ecc03a8261b2334 100644 |
| --- a/tools/gn/function_toolchain.cc |
| +++ b/tools/gn/function_toolchain.cc |
| @@ -407,6 +407,10 @@ const char kTool_Help[] = |
| " \"stamp\": Tool for creating stamp files\n" |
| " \"copy\": Tool to copy files.\n" |
| "\n" |
| + " Platform specific tools:\n" |
| + " \"copy_bundle_data\": [iOS, OS X] Tool to copy files in a bundle.\n" |
| + " \"compile_xcassets\": [iOS, OS X] Tool to compile asset catalogs.\n" |
| + "\n" |
| "Tool variables\n" |
| "\n" |
| " command [string with substitutions]\n" |
| @@ -718,6 +722,18 @@ const char kTool_Help[] = |
| " {{source}} which is the source of the copy. The stamp tool allows\n" |
| " only the common tool substitutions.\n" |
| "\n" |
| + " The copy_bundle_data and compile_xcassets tools only allows the common\n" |
| + " tool substitutions. Both tools are required to create iOS/OS X bundles\n" |
| + " and need only be defined on those platforms.\n" |
| + "\n" |
| + " The copy_bundle_data tool will be called with one source and needs to\n" |
| + " copy (optionally optimizing the data representation) to its output. It\n" |
| + " may be called with a directory as input and it needs to be recursively\n" |
| + " copied.\n" |
| + "\n" |
| + " The compile_xcassets tool will be called with one or more source (each\n" |
| + " an asset catalog) that needs to be compiled to a single output.\n" |
| + "\n" |
| "Separate linking and dependencies for shared libraries\n" |
| "\n" |
| " Shared libraries are special in that not all changes to them require\n" |
| @@ -812,9 +828,13 @@ Value RunTool(Scope* scope, |
| } else if (IsLinkerTool(tool_type)) { |
| subst_validator = &IsValidLinkerSubstitution; |
| subst_output_validator = &IsValidLinkerOutputsSubstitution; |
| - } else if (tool_type == Toolchain::TYPE_COPY) { |
| + } else if (tool_type == Toolchain::TYPE_COPY || |
| + tool_type == Toolchain::TYPE_COPY_BUNDLE_DATA) { |
| subst_validator = &IsValidCopySubstitution; |
| subst_output_validator = &IsValidCopySubstitution; |
| + } else if (tool_type == Toolchain::TYPE_COMPILE_XCASSETS) { |
| + subst_validator = &IsValidCompileXCassetsSubstitution; |
| + subst_output_validator = &IsValidCompileXCassetsSubstitution; |
| } else { |
| subst_validator = &IsValidToolSubstitution; |
| subst_output_validator = &IsValidToolSubstitution; |
| @@ -851,7 +871,10 @@ Value RunTool(Scope* scope, |
| return Value(); |
| } |
| - if (tool_type != Toolchain::TYPE_COPY && tool_type != Toolchain::TYPE_STAMP) { |
| + if (tool_type != Toolchain::TYPE_COPY && |
| + tool_type != Toolchain::TYPE_STAMP && |
| + tool_type != Toolchain::TYPE_COPY_BUNDLE_DATA && |
| + tool_type != Toolchain::TYPE_COMPILE_XCASSETS) { |
| // All tools except the copy and stamp tools should have outputs. The copy |
|
brettw
2016/03/07 21:57:30
This comment needs updating.
sdefresne
2016/03/08 14:33:30
Done.
|
| // and stamp tool's outputs are generated internally. |
| if (!ReadOutputs(&block_scope, function, subst_output_validator, |