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 9set -e 10set -x 11 12export PATH="$1/recipe_bundle/depot_tools:${PATH}" 13# Add CIPD to the PATH for vpython3 and python3. 14export 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 vpython and cipd. 16export VPYTHON_VIRTUALENV_ROOT=$1/cache/vpython 17export CIPD_CACHE_DIR=/tmp/.cipd_cache 18 19# e.g. /mnt/pd0/s/w/ir/cache/work/flutter/src 20source_dir=$2 21# e.g. /mnt/pd0/s/w/ir/cache/work/flutter/src/out/android_release 22out_dir=$3 23shift 3 24cd $source_dir 25flutter/tools/gn "$@" 26# This is why we have to mount the entire swarming directory, GN sets a command 27# to do a version check via relative path (../../flutter/third_party/gn/gn) 28ninja -v -C $out_dir -j100 29