From e93fa69c1a3ad6f246e7c5491e06f979f688cf79 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 20 May 2019 12:36:02 -0700 Subject: [PATCH 1/2] Forward custom IDE flags to GN. Also fixes an issue where the actual GN gen command would not be printed to the console. --- tools/gn | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/gn b/tools/gn index ebf8be7bff424..db8e00f368324 100755 --- a/tools/gn +++ b/tools/gn @@ -315,6 +315,10 @@ def parse_args(args): help='On the mac, the SDK is inferred from the Xcode location unless this flag is specified. ' + ' Setting the FLUTTER_MAC_SDK_PATH environment variable achieves the same effect.') + parser.add_argument('--ide', default='', type=str, + help='The IDE files to generate using GN. Use `gn gen help` and look for the --ide flag to' + + ' see supported IDEs. If this flag is not specified, a platform specific default is selected.') + return parser.parse_args(args) def main(argv): @@ -335,19 +339,21 @@ def main(argv): '--check', ] - if sys.platform == 'darwin': - # On the Mac, also generate Xcode projects for ease of editing. + if args.ide != '': + command.append('--ide=%s' % args.ide) + elif sys.platform == 'darwin': + # On the Mac, generate an Xcode project by default. command.append('--ide=xcode') - - if sys.platform.startswith('win'): - # On Windows, also generate Visual Studio project for ease of editing. + elif sys.platform.startswith('win'): + # On Windows, generate a Visual Studio project. command.append('--ide=vs') gn_args = to_command_line(to_gn_args(args)) out_dir = get_out_dir(args) - print "gn gen --check in %s" % out_dir command.append(out_dir) command.append('--args=%s' % ' '.join(gn_args)) + print "Generating GN files in: %s" % out_dir + print "Command: %s" % ' '.join(command) gn_call_result = subprocess.call(command, cwd=SRC_ROOT) if gn_call_result == 0: From 71eb29166d12e0603aafcdfb01133fbf114e131c Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 28 May 2019 12:19:59 -0700 Subject: [PATCH 2/2] PR --- tools/gn | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/gn b/tools/gn index db8e00f368324..fa8da983e28c2 100755 --- a/tools/gn +++ b/tools/gn @@ -353,7 +353,6 @@ def main(argv): command.append(out_dir) command.append('--args=%s' % ' '.join(gn_args)) print "Generating GN files in: %s" % out_dir - print "Command: %s" % ' '.join(command) gn_call_result = subprocess.call(command, cwd=SRC_ROOT) if gn_call_result == 0: