| Index: tools/gn/target_generator.cc
|
| diff --git a/tools/gn/target_generator.cc b/tools/gn/target_generator.cc
|
| index 3734ea9c3424ccf82c7511268a6438b07d9ac259..44ad2574dd7a24cca834df8882f9179f552100d2 100644
|
| --- a/tools/gn/target_generator.cc
|
| +++ b/tools/gn/target_generator.cc
|
| @@ -44,6 +44,9 @@ void TargetGenerator::Run() {
|
| if (!FillData())
|
| return;
|
|
|
| + if (!FillBundleData())
|
| + return;
|
| +
|
| if (!FillDependencies())
|
| return;
|
|
|
| @@ -84,8 +87,13 @@ void TargetGenerator::GenerateTarget(Scope* scope,
|
| target->set_defined_from(function_call);
|
|
|
| // Create and call out to the proper generator.
|
| - if (output_type == functions::kCopy) {
|
| - CopyTargetGenerator generator(target.get(), scope, function_call, err);
|
| + if (output_type == functions::kCopy ||
|
| + output_type == functions::kCopyBundleData) {
|
| + Target::OutputType target_output_type = output_type == functions::kCopy
|
| + ? Target::COPY_FILES
|
| + : Target::COPY_BUNDLE_DATA;
|
| + CopyTargetGenerator generator(target.get(), scope, function_call,
|
| + target_output_type, err);
|
| generator.Run();
|
| } else if (output_type == functions::kAction) {
|
| ActionTargetGenerator generator(target.get(), scope, function_call,
|
| @@ -238,6 +246,20 @@ bool TargetGenerator::FillData() {
|
| return true;
|
| }
|
|
|
| +bool TargetGenerator::FillBundleData() {
|
| + const Value* value = scope_->GetValue(variables::kBundleData, true);
|
| + if (!value)
|
| + return true;
|
| +
|
| + Target::FileList bundle_data;
|
| + if (!ExtractListOfRelativeFiles(scope_->settings()->build_settings(), *value,
|
| + scope_->GetSourceDir(), &bundle_data, err_))
|
| + return false;
|
| +
|
| + target_->bundle_data().insert(bundle_data.begin(), bundle_data.end());
|
| + return true;
|
| +}
|
| +
|
| bool TargetGenerator::FillDependencies() {
|
| if (!FillGenericDeps(variables::kDeps, &target_->private_deps()))
|
| return false;
|
|
|