-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
74 lines (70 loc) · 1.09 KB
/
build.sh
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
72
73
74
#!/bin/bash
GOOS=windows
GOARCH=amd64
FileName=ClanInspector.exe
BuildNumber=$(date +%y%m%d%H%M%S)
if [ ! -z "$2" ]
then
BuildNumber=$2
fi
case $1 in
win32)
GOOS=windows
GOARCH=386
FileName=ClanInspector32.exe
;;
win64)
GOOS=windows
GOARCH=amd64
FileName=ClanInspector64.exe
;;
linux32)
GOOS=linux
GOARCH=386
FileName=ClanInspector32
;;
linux64)
GOOS=linux
GOARCH=amd64
FileName=ClanInspector64
;;
all)
;;
*)
echo "Invalid OS and Architecture specified ($1)"
echo Accepted Values:
echo win32
echo win64
echo linux32
echo linux64
echo all
exit
;;
esac
if [ $1 == 'all' ]
then
counter=1
while [ $counter -le 4 ]
do
case $counter in
1)
platform=win32
;;
2)
platform=win64
;;
3)
platform=linux32
;;
4)
platform=linux64
;;
esac
./$0 $platform $BuildNumber
((counter++))
done
else
echo Building $FileName, BuildNumber=$BuildNumber
GOOS=$GOOS GOARCH=$GOARCH go build -o bin/$FileName -ldflags "-X main.buildNumber=$BuildNumber" main.go configuration.go commands.go events.go
fi
cp ClanInspector.yaml bin