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

Side by Side Diff: tools/gn/functions_target.cc

Issue 1827103005: [GN] Add support for generating Xcode projects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comment about "assert(product_type != "")" Created 4 years, 7 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
« no previous file with comments | « tools/gn/create_bundle_target_generator.cc ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 " The \"bundle_*_dir\" properties must be defined. They will be used for\n" 324 " The \"bundle_*_dir\" properties must be defined. They will be used for\n"
325 " the expansion of {{bundle_*_dir}} rules in \"bundle_data\" outputs.\n" 325 " the expansion of {{bundle_*_dir}} rules in \"bundle_data\" outputs.\n"
326 "\n" 326 "\n"
327 " This target can be used on all platforms though it is designed only to\n" 327 " This target can be used on all platforms though it is designed only to\n"
328 " generate iOS/OS X bundle. In cross-platform projects, it is advised to\n" 328 " generate iOS/OS X bundle. In cross-platform projects, it is advised to\n"
329 " put it behind iOS/Mac conditionals.\n" 329 " put it behind iOS/Mac conditionals.\n"
330 "\n" 330 "\n"
331 "Variables\n" 331 "Variables\n"
332 "\n" 332 "\n"
333 " bundle_root_dir*, bundle_resources_dir*, bundle_executable_dir*,\n" 333 " bundle_root_dir*, bundle_resources_dir*, bundle_executable_dir*,\n"
334 " bundle_plugins_dir*, deps, data_deps, public_deps, visibility\n" 334 " bundle_plugins_dir*, deps, data_deps, public_deps, visibility,\n"
335 " product_type\n"
335 " * = required\n" 336 " * = required\n"
336 "\n" 337 "\n"
337 "Example\n" 338 "Example\n"
338 "\n" 339 "\n"
339 " # Defines a template to create an application. On most platform, this\n" 340 " # Defines a template to create an application. On most platform, this\n"
340 " # is just an alias for an \"executable\" target, but on iOS/OS X, it\n" 341 " # is just an alias for an \"executable\" target, but on iOS/OS X, it\n"
341 " # builds an application bundle.\n" 342 " # builds an application bundle.\n"
342 " template(\"app\") {\n" 343 " template(\"app\") {\n"
343 " if (!is_ios && !is_mac) {\n" 344 " if (!is_ios && !is_mac) {\n"
344 " executable(target_name) {\n" 345 " executable(target_name) {\n"
(...skipping 26 matching lines...) Expand all
371 " rebase_path(\"$gen_path/$app_name\", root_build_dir)\n" 372 " rebase_path(\"$gen_path/$app_name\", root_build_dir)\n"
372 " }\n" 373 " }\n"
373 "\n" 374 "\n"
374 " bundle_data(\"${app_name}_bundle_executable\") {\n" 375 " bundle_data(\"${app_name}_bundle_executable\") {\n"
375 " deps = [ \":${app_name}_generate_executable\" ]\n" 376 " deps = [ \":${app_name}_generate_executable\" ]\n"
376 " sources = [ \"$gen_path/$app_name\" ]\n" 377 " sources = [ \"$gen_path/$app_name\" ]\n"
377 " outputs = [ \"{{bundle_executable_dir}}/$app_name\" ]\n" 378 " outputs = [ \"{{bundle_executable_dir}}/$app_name\" ]\n"
378 " }\n" 379 " }\n"
379 "\n" 380 "\n"
380 " create_bundle(\"${app_name}.app\") {\n" 381 " create_bundle(\"${app_name}.app\") {\n"
382 " product_type = \"com.apple.product-type.application\"\n"
381 " deps = [\n" 383 " deps = [\n"
382 " \":${app_name}_bundle_executable\",\n" 384 " \":${app_name}_bundle_executable\",\n"
383 " \":${app_name}_bundle_info_plist\",\n" 385 " \":${app_name}_bundle_info_plist\",\n"
384 " ]\n" 386 " ]\n"
385 " if (is_ios) {\n" 387 " if (is_ios) {\n"
386 " bundle_root_dir = \"${root_build_dir}/$target_name\"\n" 388 " bundle_root_dir = \"${root_build_dir}/$target_name\"\n"
387 " bundle_resources_dir = bundle_root_dir\n" 389 " bundle_resources_dir = bundle_root_dir\n"
388 " bundle_executable_dir = bundle_root_dir\n" 390 " bundle_executable_dir = bundle_root_dir\n"
389 " bundle_plugins_dir = bundle_root_dir + \"/Plugins\"\n" 391 " bundle_plugins_dir = bundle_root_dir + \"/Plugins\"\n"
390 " } else {\n" 392 " } else {\n"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 const Template* templ = scope->GetTemplate(target_type); 727 const Template* templ = scope->GetTemplate(target_type);
726 if (templ) 728 if (templ)
727 return templ->Invoke(scope, function, sub_args, block, err); 729 return templ->Invoke(scope, function, sub_args, block, err);
728 730
729 // Otherwise, assume the target is a built-in target type. 731 // Otherwise, assume the target is a built-in target type.
730 return ExecuteGenericTarget(target_type.c_str(), scope, function, sub_args, 732 return ExecuteGenericTarget(target_type.c_str(), scope, function, sub_args,
731 block, err); 733 block, err);
732 } 734 }
733 735
734 } // namespace functions 736 } // namespace functions
OLDNEW
« no previous file with comments | « tools/gn/create_bundle_target_generator.cc ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698