xref: /aosp_15_r20/external/skia/infra/bots/recipe_modules/build/resources/docker-flutter-compile.sh (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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 vpython3 and cipd.
16# It is ok if these folders to not exist.
17export VPYTHON_VIRTUALENV_ROOT=$1/cache/vpython3
18export CIPD_CACHE_DIR=/tmp/.cipd_cache
19
20# e.g. /mnt/pd0/s/w/ir/cache/work/flutter/src
21source_dir=$2
22# e.g. /mnt/pd0/s/w/ir/cache/work/flutter/src/out/android_release
23out_dir=$3
24shift 3
25cd $source_dir
26flutter/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)
29ninja -v -C $out_dir -j100
30