Files
chromium_depot_tools/ninja_reclient.py
Takuto Ikuta df3e577855 apply black and git cl format for ninja related python files
This is made by
$ black --line-length 79 *ninja*.py
$ git cl format

Change-Id: Ic446898a5461ae536542f6312cae2ce126dfe82a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5035265
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Philipp Wollermann <philwo@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
2023-11-16 07:14:49 +00:00

29 lines
857 B
Python
Executable File

#!/usr/bin/env python3
# Copyright 2023 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script is a wrapper around the ninja.py script that also
handles the client lifecycle safely. It will automatically start
reproxy before running ninja and stop reproxy when ninja stops
for any reason eg. build completes, keyboard interupt etc."""
import sys
import ninja
import reclient_helper
def main(argv):
with reclient_helper.build_context(argv, "ninja_reclient") as ret_code:
if ret_code:
return ret_code
try:
return ninja.main(argv)
except KeyboardInterrupt:
print("Shutting down reproxy...", file=sys.stderr)
return 1
if __name__ == "__main__":
sys.exit(main(sys.argv))