Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -335,19 +339,20 @@ 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put these outputs behind a verbose flag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spoke to Jason and we agreed that we should just print the out directory. If folks need to see the GN gen arguments, they can view it in the arg.gn file.

gn_call_result = subprocess.call(command, cwd=SRC_ROOT)

if gn_call_result == 0:
Expand Down