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