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

Unified Diff: tools/gn/copy_target_generator.cc

Issue 1606553002: Add support for Mac/iOS application bundles to GN tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit tests & support for bundle_data_filter Created 4 years, 11 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
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 "

Powered by Google App Engine
This is Rietveld 408576698