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

Side by Side Diff: tools/gn/functions_target.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: base_unittests builds and pass all tests with GN 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 unified diff | Download patch
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/functions.h" 5 #include "tools/gn/functions.h"
6 6
7 #include "tools/gn/config_values_generator.h" 7 #include "tools/gn/config_values_generator.h"
8 #include "tools/gn/err.h" 8 #include "tools/gn/err.h"
9 #include "tools/gn/parse_tree.h" 9 #include "tools/gn/parse_tree.h"
10 #include "tools/gn/scope.h" 10 #include "tools/gn/scope.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 const std::vector<Value>& args, 292 const std::vector<Value>& args,
293 Scope* scope, 293 Scope* scope,
294 Err* err) { 294 Err* err) {
295 if (!EnsureNotProcessingImport(function, scope, err) || 295 if (!EnsureNotProcessingImport(function, scope, err) ||
296 !EnsureNotProcessingBuildConfig(function, scope, err)) 296 !EnsureNotProcessingBuildConfig(function, scope, err))
297 return Value(); 297 return Value();
298 TargetGenerator::GenerateTarget(scope, function, args, functions::kCopy, err); 298 TargetGenerator::GenerateTarget(scope, function, args, functions::kCopy, err);
299 return Value(); 299 return Value();
300 } 300 }
301 301
302 // copy bundle data ------------------------------------------------------------
303
304 const char kCopyBundleData[] = "copy_bundle_data";
305 const char kCopyBundleData_HelpShort[] =
306 "copy_bundle_data: Declare a target that copies files to app bundle.";
307 const char kCopyBundleData_Help[] =
308 "copy_bundle_data: Declare a target that copies files to app bundle.\n"
309 "\n"
310 "More detailed help need to be written\n";
brettw 2016/01/20 22:23:17 Please do this :)
sdefresne 2016/01/21 22:00:56 Done.
311
312 Value RunCopyBundleData(const FunctionCallNode* function,
313 const std::vector<Value>& args,
314 Scope* scope,
315 Err* err) {
316 if (!EnsureNotProcessingImport(function, scope, err) ||
317 !EnsureNotProcessingBuildConfig(function, scope, err))
318 return Value();
319 TargetGenerator::GenerateTarget(
320 scope, function, args, functions::kCopyBundleData, err);
321 return Value();
322 }
323
302 // executable ------------------------------------------------------------------ 324 // executable ------------------------------------------------------------------
303 325
304 const char kExecutable[] = "executable"; 326 const char kExecutable[] = "executable";
305 const char kExecutable_HelpShort[] = 327 const char kExecutable_HelpShort[] =
306 "executable: Declare an executable target."; 328 "executable: Declare an executable target.";
307 const char kExecutable_Help[] = 329 const char kExecutable_Help[] =
308 "executable: Declare an executable target.\n" 330 "executable: Declare an executable target.\n"
309 "\n" 331 "\n"
310 "Variables\n" 332 "Variables\n"
311 "\n" 333 "\n"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 const Template* templ = scope->GetTemplate(target_type); 579 const Template* templ = scope->GetTemplate(target_type);
558 if (templ) 580 if (templ)
559 return templ->Invoke(scope, function, sub_args, block, err); 581 return templ->Invoke(scope, function, sub_args, block, err);
560 582
561 // Otherwise, assume the target is a built-in target type. 583 // Otherwise, assume the target is a built-in target type.
562 return ExecuteGenericTarget(target_type.c_str(), scope, function, sub_args, 584 return ExecuteGenericTarget(target_type.c_str(), scope, function, sub_args,
563 block, err); 585 block, err);
564 } 586 }
565 587
566 } // namespace functions 588 } // namespace functions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698