-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-nomodules.sh
executable file
·95 lines (72 loc) · 1.51 KB
/
build-nomodules.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
step=0
msg() {
step=$((step+1))
echo >&2 $step. $*
}
get() {
i=$1
msg fetching $i
go get $i
msg fetching $i - done
}
pkg=github.com/udhos/fugo
check() {
local sub=$1
local full=$pkg/$sub
msg fmt $sub
gofmt -s -w $sub/*.go
msg fix $sub
go tool fix $sub/*.go
msg vet $sub
go tool vet $sub
msg gosimple $sub
hash gosimple && gosimple $sub/*.go
msg golint $sub
hash golint && golint $sub/*.go
msg staticcheck $sub
hash staticcheck && staticcheck $sub/*.go
msg unused $sub
hash unused && unused $sub/*.go
msg test $full
go test $full
}
build() {
local sub=$1
local full=$pkg/$sub
check $sub
msg desktop install $full
go install $full
}
mobilebuild() {
local sub=$1
local full=$pkg/$sub
build $sub
msg android build $full
gomobile build -target=android $full
msg now use this command do push to android device:
echo gomobile install $full
}
get honnef.co/go/tools/cmd/unused
get honnef.co/go/tools/cmd/gosimple
get honnef.co/go/tools/cmd/staticcheck
get github.com/golang/lint/golint
get github.com/udhos/pixfont
get github.com/udhos/goglmath
get golang.org/x/net/ipv4
get github.com/faiface/beep
get github.com/hajimehoshi/oto
get github.com/pkg/errors
check future
check msg
check trace
check unit
check version
if [ "$1" != arena ]; then
mobilebuild demo/square
mobilebuild demo/triangle2
mobilebuild demo/triangle
mobilebuild demo/invader
fi
build demo/font
build arena