72f6668eb7
In general, vars should only contain variables which are the same for all tasks. Variables specific to compilation belong in the build module (or compile recipe), and those specific to running tests belong in the flavor module, or the individual recipe which uses them. Bug: skia:6473 Change-Id: Ifd55a57118c5801e6f4934a6b5de9d1567415b9a Reviewed-on: https://skia-review.googlesource.com/128545 Commit-Queue: Eric Boren <borenet@google.com> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
37 lines
945 B
Python
37 lines
945 B
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, checkout_root, out_dir):
|
|
flutter_dir = checkout_root.join('src')
|
|
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.
|
|
api.run.rmtree(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_dir, '-j100'])
|
|
|
|
|
|
def copy_extra_build_products(api, src, dst):
|
|
pass
|