This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unity-meta-check-build-toolchains
executable file
·71 lines (57 loc) · 2.18 KB
/
unity-meta-check-build-toolchains
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
set -xeuo pipefail
BASE_DIR="$(cd "$(dirname "$0")"; pwd)"
TMP_DIR="${BASE_DIR}/tmp"
LINUX_AMD64_DIR="${BASE_DIR}/linux-amd64"
DARWIN_AMD64_DIR="${BASE_DIR}/darwin-amd64"
WINDOWS_AMD64_DIR="${BASE_DIR}/windows-amd64"
LINUX_ARM64_DIR="${BASE_DIR}/linux-arm64"
DARWIN_ARM64_DIR="${BASE_DIR}/darwin-arm64"
WINDOWS_ARM64_DIR="${BASE_DIR}/windows-arm64"
main() {
local revision="$1"
local outdir="${BASE_DIR}"
local workspace="${TMP_DIR}/${revision}"
mkdir -p "$TMP_DIR"
if [[ -d "$workspace" ]]; then
(cd "$workspace"; git fetch --prune)
else
git clone [email protected]:DeNA/unity-meta-check "$workspace"
fi
(cd "$workspace"
git checkout -f "$revision"
git submodule update --init --recursive
make test clean all
mkdir -p "$LINUX_AMD64_DIR"
while read binpath; do
local short_basename="$(basename "$binpath" | sed 's/-linux-amd64$//')"
mv "$binpath" "${LINUX_AMD64_DIR}/${short_basename}"
done < <(find ./out -name '*-linux-amd64')
mkdir -p "$LINUX_ARM64_DIR"
while read binpath; do
local short_basename="$(basename "$binpath" | sed 's/-linux-arm64$//')"
mv "$binpath" "${LINUX_ARM64_DIR}/${short_basename}"
done < <(find ./out -name '*-linux-arm64')
mkdir -p "$DARWIN_AMD64_DIR"
while read binpath; do
local short_basename="$(basename "$binpath" | sed 's/-darwin-amd64$//')"
mv "$binpath" "${DARWIN_AMD64_DIR}/${short_basename}"
done < <(find ./out -name '*-darwin-amd64')
mkdir -p "$DARWIN_ARM64_DIR"
while read binpath; do
local short_basename="$(basename "$binpath" | sed 's/-darwin-arm64$//')"
mv "$binpath" "${DARWIN_ARM64_DIR}/${short_basename}"
done < <(find ./out -name '*-darwin-arm64')
mkdir -p "$WINDOWS_AMD64_DIR"
while read binpath; do
local short_basename="$(basename "$binpath" | sed 's/-windows-amd64\.exe$/.exe/')"
mv "$binpath" "${WINDOWS_AMD64_DIR}/${short_basename}"
done < <(find ./out -name '*-windows-amd64.exe')
mkdir -p "$WINDOWS_ARM64_DIR"
while read binpath; do
local short_basename="$(basename "$binpath" | sed 's/-windows-arm64\.exe$/.exe/')"
mv "$binpath" "${WINDOWS_ARM64_DIR}/${short_basename}"
done < <(find ./out -name '*-windows-arm64.exe')
)
}
main "$@"