1617a3babSopenharmony_ci#!/bin/bash
2617a3babSopenharmony_ci
3617a3babSopenharmony_ci# Copyright (C) 2020 Google, Inc.
4617a3babSopenharmony_ci#
5617a3babSopenharmony_ci# All rights reserved.
6617a3babSopenharmony_ci#
7617a3babSopenharmony_ci# Redistribution and use in source and binary forms, with or without
8617a3babSopenharmony_ci# modification, are permitted provided that the following conditions
9617a3babSopenharmony_ci# are met:
10617a3babSopenharmony_ci#
11617a3babSopenharmony_ci#    Redistributions of source code must retain the above copyright
12617a3babSopenharmony_ci#    notice, this list of conditions and the following disclaimer.
13617a3babSopenharmony_ci#
14617a3babSopenharmony_ci#    Redistributions in binary form must reproduce the above
15617a3babSopenharmony_ci#    copyright notice, this list of conditions and the following
16617a3babSopenharmony_ci#    disclaimer in the documentation and/or other materials provided
17617a3babSopenharmony_ci#    with the distribution.
18617a3babSopenharmony_ci#
19617a3babSopenharmony_ci#    Neither the name of Google Inc. nor the names of its
20617a3babSopenharmony_ci#    contributors may be used to endorse or promote products derived
21617a3babSopenharmony_ci#    from this software without specific prior written permission.
22617a3babSopenharmony_ci#
23617a3babSopenharmony_ci# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24617a3babSopenharmony_ci# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25617a3babSopenharmony_ci# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26617a3babSopenharmony_ci# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27617a3babSopenharmony_ci# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28617a3babSopenharmony_ci# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29617a3babSopenharmony_ci# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30617a3babSopenharmony_ci# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31617a3babSopenharmony_ci# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32617a3babSopenharmony_ci# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33617a3babSopenharmony_ci# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34617a3babSopenharmony_ci# POSSIBILITY OF SUCH DAMAGE.
35617a3babSopenharmony_ci
36617a3babSopenharmony_ciset -e # Fail on any error.
37617a3babSopenharmony_ci
38617a3babSopenharmony_ci. /bin/using.sh # Declare the bash `using` function for configuring toolchains.
39617a3babSopenharmony_ci
40617a3babSopenharmony_ciset -x # Display commands being run.
41617a3babSopenharmony_ci
42617a3babSopenharmony_ciusing ninja-1.10.0
43617a3babSopenharmony_ci
44617a3babSopenharmony_ci# Disable git's "detected dubious ownership" error - kokoro checks out the repo
45617a3babSopenharmony_ci# with a different user, and we don't care about this warning.
46617a3babSopenharmony_cigit config --global --add safe.directory '*'
47617a3babSopenharmony_ci
48617a3babSopenharmony_ciecho "Fetching external projects..."
49617a3babSopenharmony_ci./update_glslang_sources.py
50617a3babSopenharmony_ci
51617a3babSopenharmony_ciecho "Fetching depot_tools..."
52617a3babSopenharmony_cimkdir -p /tmp/depot_tools
53617a3babSopenharmony_cicurl https://storage.googleapis.com/chrome-infra/depot_tools.zip -o /tmp/depot_tools.zip
54617a3babSopenharmony_ciunzip /tmp/depot_tools.zip -d /tmp/depot_tools
55617a3babSopenharmony_cirm /tmp/depot_tools.zip
56617a3babSopenharmony_ciexport PATH="/tmp/depot_tools:$PATH"
57617a3babSopenharmony_ci
58617a3babSopenharmony_ciecho "Syncing client..."
59617a3babSopenharmony_cigclient sync --gclientfile=standalone.gclient
60617a3babSopenharmony_cign gen out/Default
61617a3babSopenharmony_ci
62617a3babSopenharmony_ciecho "Building..."
63617a3babSopenharmony_cicd out/Default
64617a3babSopenharmony_cininja
65