Debian Codegraph @

infra/bots/recipe_modules/build/resources/docker-flutter-compile.sh

raw
1 #!/bin/bash
2 # Copyright 2020 Google LLC
3 #
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Call with <swarming dir> <top level of flutter checkout> <out_dir> [GN arguments...]
8
9 set -e
10 set -x
11
12 export PATH="$1/recipe_bundle/depot_tools:${PATH}"
13 # Add CIPD to the PATH for vpython3 and python3.
14 export PATH="$1/cipd_bin_packages:$1/cipd_bin_packages/bin:$1/cipd_bin_packages/cpython3:$1/cipd_bin_packages/cpython3/bin:${PATH}"
15 # Set env for vpython3 and cipd.
16 # It is ok if these folders to not exist.
17 export VPYTHON_VIRTUALENV_ROOT=$1/cache/vpython3
18 export CIPD_CACHE_DIR=/tmp/.cipd_cache
19
20 # e.g. /mnt/pd0/s/w/ir/cache/work/flutter/src
21 source_dir=$2
22 # e.g. /mnt/pd0/s/w/ir/cache/work/flutter/src/out/android_release
23 out_dir=$3
24 shift 3
25 cd $source_dir
26 flutter/tools/gn "$@"
27 # This is why we have to mount the entire swarming directory, GN sets a command
28 # to do a version check via relative path (../../flutter/third_party/gn/gn)
29 ninja -v -C $out_dir -j100