-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmrun.sh
139 lines (124 loc) · 5.14 KB
/
mrun.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/env bash
###############################################################################
# Macaroni Build Helper
###############################################################################
#
# I've got the memory of a peacock so I like to make Bash scripts like this
# to help run things.
#
# To make this work, you'll need to run "git submodule update --init" at least
# once.
#
# If you hate Bash, then fine- don't use it! Go run the commands by hand. The
# goal of this script is as more about making it easy to remember what command
# line invocation did what than it is about automation.
#
###############################################################################
set -e
bashi_base_command="${bashi_base_command:-$0}"
readonly m_root=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if [ "" == "${WINDIR}" ]; then
readonly this_is_windows=
function conan() {
conan $@
}
else
readonly this_is_windows=true
function conan() {
cmd //c conan $@
}
fi
function cavatappi() {
"${m_root}/Main/App/build/release/bin/macaroni.exe" --generatorPath="${m_root}/Main/Generators" --libraryRepoPath="${m_root}/Main/Libraries" --messagesPath="${m_root}/Main/App/Source/main/resources/Messages.txt" $@
}
function cmd_clean() {
# Delete the build directory
cd "${m_root}/Main/App"
rm -rf ./build
}
function cmd_build_deps() {
# Builds dependencies
cd "${m_root}/Main/Dependencies/Lua"
conan export demo/testing
conan test_package
}
function cmd_build() {
# Build the main app
cd "${m_root}/Main/App"
mkdir -p build/release
cd build/release
if [ "" == "${this_is_windows}" ]; then
conan install ../.. -s 'compiler=Visual Studio' -s compiler.version=12 -s build_type=Release -s arch=x86_64 -s os=Windows
else
cmd //c conan install ../.. -s compiler=Visual\ Studio -s compiler.version=12 -s build_type=Release -s arch=x86_64 -s os=Windows
fi
conan build ../..
}
function cmd_unit_tests() {
# Run the meager unit tests.
cd "${m_root}/Main/App"
./build/bin/macaroni.exe \
--luaTests=Source/test/lua \
--messagesPath=Source/main/resources/Messages.txt
}
function cmd_tests() {
# Run the integration tests
cd "${m_root}/Next/Tests"
cavatappi -c -i
}
function cmd_refresh () {
# Refresh the command list.
mkdir -p Output
python "${m_root}/BashiBazook/bashi.py" "${m_root}/mrun.sh" > "${m_root}/mrun.bashi-q"
cp "${m_root}/mrun.bashi-q" "${m_root}/mrun.bashi"
}
bashi_help_preamble="
:;;
;;;;.
;;;;;;
;;;';;;;
;;;'';;;;\`
;;;''';;;;;; @#@#
:;;''''';;;;;;;:. @':@
\`;;;'''''''';;;;;;; @'#@ #@@; @++@\`
;;;'''''''''''';;;;;;\` \`@@@,:@ @#,,@@+@;,,@.@@@
:;;;''''''''''''';;;;;;, ,@:,@@@@.#+,,#@@',@;,@\`#,+;
;;;;'''''''''''''';;;;;@#@,;@:,,,@@,,'@@@#@@@,# @@+@'
;;;;''''''''''''''';;;;#@:@,,,#@+',,@@::@,+@++@:,,,@
;;;;'''''''''''''''';;;#@:,,@+,#+,,@@::@@#:#@',:@@; @@#
.;;;'''''''''''''''';;;#,,'+,#@@@@@:@@@+,,,:@#@,@ , @,;@'
:;;;''''''''''''''';;;#@@:@+,,,,#@;,@,,,;@#@,:@@+@@,,,@
\`;;;;;'''''''''''';;;;'@,@@,,@',#@#,,:@,@+@@@@;@@,,:@
;;;;;''''''''''';;;:,@@,,@#,,+@,,@@@@#:,@@@@@,,@
:;;;;;;'''''''''';;;;,,,:,,,,@;,@:,,;@@#+:@,,:@
\`;;;;;;;;'''''''';;;#@@@,,,,@,@,,::,,@'@:,,@\`
\`;;;;;;;;;''''''';@@@@,,,@@',@@@@,,@,,,##@
.@#';;;;;;;;;;'''@@@'@@#@,@;@,@','',+@,@
@@@:@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