skia2/infra/bots/recipe_modules/build/flutter.py
Eric Boren f3a21d0540 [recipes] Move 'gclient runhooks' from flutter build to core
Bug: skia:6473
Change-Id: I89b384668a6a45eaae9995ad8f7b404a1b7f9824
Reviewed-on: https://skia-review.googlesource.com/128318
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2018-05-16 12:56:54 +00:00

39 lines
1.0 KiB
Python

# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def compile_fn(api, _):
flutter_dir = api.vars.checkout_root.join('src')
configuration = api.vars.builder_cfg.get('configuration').lower()
extra_tokens = api.vars.extra_tokens
out_dir = configuration
with api.context(cwd=flutter_dir):
# Setup GN args.
gn_args = [
'--runtime-mode=%s' % configuration,
]
if 'Android' in extra_tokens:
gn_args.append('--android')
out_dir = 'android_' + out_dir
# Delete out_dir so that we start from a clean slate. See skbug/6310.
api.run.rmtree(flutter_dir.join('out', out_dir))
# Run GN.
api.run(
api.step,
'gn_gen',
cmd=['flutter/tools/gn'] + gn_args)
# Build Flutter.
api.run(
api.step,
'build_flutter',
cmd=['ninja', '-C', 'out/' + out_dir, '-j100'])
def copy_extra_build_products(api, src, dst):
pass