| Index: tools/gn/copy_target_generator.cc
|
| diff --git a/tools/gn/copy_target_generator.cc b/tools/gn/copy_target_generator.cc
|
| index 994011e824e614e5bdb5660d1a501fe2af7d5c64..24ca1fe65cf78fdf6e0a5722a5f589628d1234cf 100644
|
| --- a/tools/gn/copy_target_generator.cc
|
| +++ b/tools/gn/copy_target_generator.cc
|
| @@ -13,26 +13,37 @@
|
| CopyTargetGenerator::CopyTargetGenerator(Target* target,
|
| Scope* scope,
|
| const FunctionCallNode* function_call,
|
| + Target::OutputType output_type,
|
| Err* err)
|
| - : TargetGenerator(target, scope, function_call, err) {
|
| -}
|
| + : TargetGenerator(target, scope, function_call, err),
|
| + output_type_(output_type) {}
|
|
|
| CopyTargetGenerator::~CopyTargetGenerator() {
|
| }
|
|
|
| void CopyTargetGenerator::DoRun() {
|
| - target_->set_output_type(Target::COPY_FILES);
|
| + target_->set_output_type(output_type_);
|
| +
|
| + if (output_type_ == Target::COPY_FILES) {
|
| + if (!FillSources())
|
| + return;
|
| +
|
| + if (target_->sources().empty()) {
|
| + *err_ = Err(
|
| + function_call_, "Empty sources for copy command.",
|
| + "You have to specify at least one file to copy in the \"sources\".");
|
| + return;
|
| + }
|
| + }
|
| +
|
| + if (output_type_ == Target::COPY_BUNDLE_DATA) {
|
| + if (!FillBundleDataFilter())
|
| + return;
|
| + }
|
|
|
| - if (!FillSources())
|
| - return;
|
| if (!FillOutputs(true))
|
| return;
|
|
|
| - if (target_->sources().empty()) {
|
| - *err_ = Err(function_call_, "Empty sources for copy command.",
|
| - "You have to specify at least one file to copy in the \"sources\".");
|
| - return;
|
| - }
|
| if (target_->action_values().outputs().list().size() != 1) {
|
| *err_ = Err(function_call_, "Copy command must have exactly one output.",
|
| "You must specify exactly one value in the \"outputs\" array for the "
|
|
|