-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·101 lines (86 loc) · 1.67 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/local/bin/bash
runtime="mono"
cljcomp=$CLOJURE_LOAD_PATH/Clojure.Compile.exe
BUILD_PATH=build/
EXTERN_PATH=extern/
MAIN_NS=chromium.core
clean_up(){
rm -rf build/*
rm -rf release/*
}
link_dlls(){
if [ -d "$BUILD_PATH" ]; then
clean_up
ln -s $CLOJURE_LOAD_PATH/*.dll build/
cd build/
ln -s ../extern/OpenTK/lib/net20/OpenTK.dll .
cd ../
else
mkdir $BUILD_PATH
link_dlls
fi
}
install_deps(){
if [ ! -d "$EXTERN_PATH" ]; then
mkdir extern
cd extern/
nuget install OpenTK -ExcludeVersion
nuget install ILRepack -ExcludeVersion
cd ../
#nuget install ilmerge
fi
}
compile(){
install_deps
link_dlls
CLOJURE_COMPILE_PATH=$BUILD_PATH $runtime $cljcomp $MAIN_NS
}
run(){
$runtime build/$MAIN_NS.exe
}
build(){
rm -rf release
mkdir release
cp $CLOJURE_LOAD_PATH/*.dll release/
cp build/*.exe release/
echo "A build created in release directory"
}
release(){
echo "Does nothing for now .. will build a minimal exe eventually"
#TODO: mono extern/ILMerge.3.0.29/tools/net452/ILMerge.exe ILRepack or monolinker/mkbundle
}
case "$1" in
c|compile)
compile
;;
l|link)
link_dlls
;;
r|run)
run
;;
b|build)
build
;;
z|rel)
release
;;
q|clean)
clean_up
;;
cr|comprun)
compile
run
;;
*)
echo "Mono Chromium build script."
echo "Usage: $0 [Options]"
echo "Mandatory Options :
c | compile - compile
l | link - link dlls as symlink in build dir.
r | run - run
b | build - build
z | rel - release
cr | comprun - Compile and Run
q | clean - Cleanup"
esac