2018-05-14 16:50:38 +00:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
|
2018-05-18 11:36:55 +00:00
|
|
|
def compile_fn(api, checkout_root, out_dir):
|
|
|
|
flutter_dir = checkout_root.join('src')
|
2018-05-14 16:50:38 +00:00
|
|
|
configuration = api.vars.builder_cfg.get('configuration').lower()
|
|
|
|
extra_tokens = api.vars.extra_tokens
|
|
|
|
|
|
|
|
with api.context(cwd=flutter_dir):
|
|
|
|
# Setup GN args.
|
|
|
|
gn_args = [
|
|
|
|
'--runtime-mode=%s' % configuration,
|
|
|
|
]
|
|
|
|
if 'Android' in extra_tokens:
|
|
|
|
gn_args.append('--android')
|
|
|
|
|
|
|
|
# Delete out_dir so that we start from a clean slate. See skbug/6310.
|
2018-05-18 11:36:55 +00:00
|
|
|
api.run.rmtree(out_dir)
|
2018-05-14 16:50:38 +00:00
|
|
|
|
|
|
|
# Run GN.
|
|
|
|
api.run(
|
|
|
|
api.step,
|
|
|
|
'gn_gen',
|
|
|
|
cmd=['flutter/tools/gn'] + gn_args)
|
|
|
|
|
|
|
|
# Build Flutter.
|
|
|
|
api.run(
|
|
|
|
api.step,
|
|
|
|
'build_flutter',
|
2018-05-18 11:36:55 +00:00
|
|
|
cmd=['ninja', '-C', out_dir, '-j100'])
|
2018-05-14 16:50:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
def copy_extra_build_products(api, src, dst):
|
|
|
|
pass
|