Bruce Dawson | ebebd95 | 2017-05-31 21:24:38 | [diff] [blame] | 1 | #!/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 Madill | 5f16d6d | 2021-04-14 20:38:00 | [diff] [blame] | 7 | # In git bash on Windows, invoke the batch file. |
Sylvain Defresne | 5506fbf | 2021-04-15 15:42:10 | [diff] [blame] | 8 | if [ "$(expr "$(uname -s)" : "^MINGW64_NT")" == "10" ]; then |
Jamie Madill | 5f16d6d | 2021-04-14 20:38:00 | [diff] [blame] | 9 | autoninja.bat "$@" |
| 10 | exit |
| 11 | fi |
| 12 | |
Takuto Ikuta | 2ee8375 | 2019-05-29 05:08:33 | [diff] [blame] | 13 | if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then |
| 14 | export NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es ] " |
| 15 | fi |
| 16 | |
Junji Watanabe | e636a67 | 2025-03-26 04:41:56 | [diff] [blame] | 17 | scriptdir=$(dirname -- "$0") |
| 18 | python_path="${scriptdir}/python-bin/python3" |
| 19 | |
Bruce Dawson | ebebd95 | 2017-05-31 21:24:38 | [diff] [blame] | 20 | # Execute whatever is printed by autoninja.py. |
| 21 | # Also print it to reassure that the right settings are being used. |
Junji Watanabe | e636a67 | 2025-03-26 04:41:56 | [diff] [blame] | 22 | "${python_path}" "${scriptdir}/autoninja.py" "$@" |
Philipp Wollermann | 0b94340 | 2023-10-12 07:13:30 | [diff] [blame] | 23 | retval=$? |
Takuto Ikuta | 8794a84 | 2019-01-10 01:41:25 | [diff] [blame] | 24 | |
Philipp Wollermann | 0b94340 | 2023-10-12 07:13:30 | [diff] [blame] | 25 | if [ "$retval" == "0" ] && [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then |
Junji Watanabe | e636a67 | 2025-03-26 04:41:56 | [diff] [blame] | 26 | "${python_path}" "${scriptdir}//post_build_ninja_summary.py" "$@" |
Bruce Dawson | e186e50 | 2018-02-12 23:41:11 | [diff] [blame] | 27 | fi |
Takuto Ikuta | 687c59d | 2019-01-29 22:59:36 | [diff] [blame] | 28 | |
Philipp Wollermann | 0b94340 | 2023-10-12 07:13:30 | [diff] [blame] | 29 | # Pass-through autoninja's error code so that if a developer types: |
Bruce Dawson | 46541b4 | 2018-02-13 19:14:12 | [diff] [blame] | 30 | # "autoninja chrome && chrome" then chrome won't run if the build fails. |
Philipp Wollermann | 0b94340 | 2023-10-12 07:13:30 | [diff] [blame] | 31 | exit $retval |