-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-modules.sh
executable file
·74 lines (52 loc) · 1.05 KB
/
build-modules.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
#!/bin/sh
step=0
msg() {
step=$((step+1))
echo >&2 $step. $*
}
check() {
local sub=$1
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 $sub
go test $sub
}
build() {
local sub=$1
check $sub
msg desktop install $sub
go install $sub
}
mobilebuild() {
local sub=$1
build $sub
msg android build $sub
gomobile build -target=android $sub
msg now use this command do push to android device:
echo gomobile install $sub
}
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