diff --git a/build-windows.sh b/build-windows.sh index 07d53d4..507d880 100755 --- a/build-windows.sh +++ b/build-windows.sh @@ -3,8 +3,6 @@ # Copyright 2022-2024 Google LLC. # SPDX-License-Identifier: Apache-2.0 -set -e - if ! uname | grep -q 'MINGW64_NT'; then echo 'This script should run on MSYS2 bash' echo diff --git a/build.sh b/build.sh index 26ca804..6ae3123 100755 --- a/build.sh +++ b/build.sh @@ -3,8 +3,6 @@ # Copyright 2022-2024 Google LLC. # SPDX-License-Identifier: Apache-2.0 -set -e - . common.sh OS=$(uname | tr '[:upper:]' '[:lower:]') diff --git a/clean.sh b/clean.sh deleted file mode 100755 index 8414d34..0000000 --- a/clean.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2022-2023 Google LLC. -# SPDX-License-Identifier: Apache-2.0 - -set -e - -rm -rf rust llvm-project llvm_android toolchain-utils\ - out out.arm out.x86 ndk tmp mingw64 \ - android-ndk-*.zip ondk-* dist mingw.7z diff --git a/common.sh b/common.sh index 693bc2d..06eba41 100644 --- a/common.sh +++ b/common.sh @@ -17,6 +17,9 @@ OUTPUT_VERSION='r27.0' PYTHON_CMD='python3' +set -e +shopt -s nullglob + # url sha git_clone_sha() { local dir=${1##*/} @@ -36,9 +39,9 @@ git_clone_branch() { clone() { git_clone_branch https://github.com/rust-lang/rust $RUST_VERSION cd rust - # for p in ../patches/*.patch; do - # patch -p1 < $p - # done + for p in ../patches/*.patch; do + patch -p1 < $p + done # Skip rust llvm sed 's:\[submodule "src/llvm-project"\]:&\n\tupdate = none:' .gitmodules > .gitmodules.p mv .gitmodules.p .gitmodules @@ -117,6 +120,11 @@ run_cmd() { rm -rf dist ondk-* dist ;; + clean) + rm -rf rust llvm-project llvm_android toolchain-utils \ + out out.arm out.x86 ndk tmp mingw64 \ + android-ndk-*.zip ondk-* dist mingw.7z + ;; *) echo "Unknown action \"$1\"" echo "./build.sh clone/build/ndk/dist"