blob: 9a10ff705d67603a0ad54555ce44d47d7688c372 [file] [log] [blame]
Bruce Dawsonebebd952017-05-31 21:24:381#!/usr/bin/env bash
2
3# Copyright (c) 2017 Google Inc. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
Jamie Madill5f16d6d2021-04-14 20:38:007# In git bash on Windows, invoke the batch file.
Sylvain Defresne5506fbf2021-04-15 15:42:108if [ "$(expr "$(uname -s)" : "^MINGW64_NT")" == "10" ]; then
Jamie Madill5f16d6d2021-04-14 20:38:009 autoninja.bat "$@"
10 exit
11fi
12
Takuto Ikuta2ee83752019-05-29 05:08:3313if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then
14 export NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es ] "
15fi
16
Junji Watanabee636a672025-03-26 04:41:5617scriptdir=$(dirname -- "$0")
18python_path="${scriptdir}/python-bin/python3"
19
Bruce Dawsonebebd952017-05-31 21:24:3820# Execute whatever is printed by autoninja.py.
21# Also print it to reassure that the right settings are being used.
Junji Watanabee636a672025-03-26 04:41:5622"${python_path}" "${scriptdir}/autoninja.py" "$@"
Philipp Wollermann0b943402023-10-12 07:13:3023retval=$?
Takuto Ikuta8794a842019-01-10 01:41:2524
Philipp Wollermann0b943402023-10-12 07:13:3025if [ "$retval" == "0" ] && [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then
Junji Watanabee636a672025-03-26 04:41:5626 "${python_path}" "${scriptdir}//post_build_ninja_summary.py" "$@"
Bruce Dawsone186e502018-02-12 23:41:1127fi
Takuto Ikuta687c59d2019-01-29 22:59:3628
Philipp Wollermann0b943402023-10-12 07:13:3029# Pass-through autoninja's error code so that if a developer types:
Bruce Dawson46541b42018-02-13 19:14:1230# "autoninja chrome && chrome" then chrome won't run if the build fails.
Philipp Wollermann0b943402023-10-12 07:13:3031exit $retval