diff --git a/.gitignore b/.gitignore index cb3efa641..df6c9d7ed 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ /.cipd_client* /.versions +# ignore ninja.exe copied from .cipd_bin. +/ninja.exe + # Ignore "disable auto update" sentinel file. .disable_auto_update diff --git a/cipd_bin_setup.bat b/cipd_bin_setup.bat index 11350cdea..3936fc0d5 100644 --- a/cipd_bin_setup.bat +++ b/cipd_bin_setup.bat @@ -3,4 +3,6 @@ :: Use of this source code is governed by a BSD-style license that can be :: found in the LICENSE file. -"%~dp0\cipd.bat" ensure -log-level warning -ensure-file "%~dp0\cipd_manifest.txt" -root "%~dp0\.cipd_bin" +call "%~dp0\cipd.bat" ensure -log-level warning -ensure-file "%~dp0\cipd_manifest.txt" -root "%~dp0\.cipd_bin" +:: copy ninja.exe to the root since many places assume ninja.exe exists in depot_tools. +copy /y "%~dp0\.cipd_bin\ninja.exe" "%~dp0\ninja.exe" > nul diff --git a/ninja b/ninja index 4b3f98702..99a6c7e35 100755 --- a/ninja +++ b/ninja @@ -1,40 +1,11 @@ #!/usr/bin/env bash -# Copyright (c) 2012 Google Inc. All rights reserved. +# Copyright 2022 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. -OS="$(uname -s)" -THIS_DIR="$(dirname "${0}")" +# See revert instructions in cipd_manifest.txt -function print_help() { -cat <<-EOF -No prebuilt ninja binary was found for this system. -Try building your own binary by doing: - cd ~ - git clone https://github.com/ninja-build/ninja.git -b v1.8.2 - cd ninja && ./configure.py --bootstrap -Then add ~/ninja/ to your PATH. -EOF -} +MYPATH="$(dirname "${BASH_SOURCE[0]}")" -case "$OS" in - Linux) - MACHINE=$(uname -m) - case "$MACHINE" in - x86_64) - exec "${THIS_DIR}/ninja-linux64" "$@";; - *) - echo Unsupported architecture \($MACHINE\) -- unable to run ninja. - print_help - exit 1;; - esac - ;; - Darwin) exec "${THIS_DIR}/ninja-mac" "$@";; - CYGWIN*) exec cmd.exe /c $(cygpath -t windows $0).exe "$@";; - MINGW*) cmd.exe //c $0.exe "$@";; - MSYS_NT*) cmd.exe //c $0.exe "$@";; - *) echo "Unsupported OS ${OS}" - print_help - exit 1;; -esac +exec "$MYPATH/.cipd_bin/ninja" "$@" diff --git a/ninja-linux64 b/ninja-linux64 deleted file mode 100755 index d72fb5679..000000000 Binary files a/ninja-linux64 and /dev/null differ diff --git a/ninja-mac b/ninja-mac deleted file mode 100755 index 995ccc000..000000000 Binary files a/ninja-mac and /dev/null differ diff --git a/ninja.exe b/ninja.exe deleted file mode 100755 index f86ef0738..000000000 Binary files a/ninja.exe and /dev/null differ