This repository has been archived by the owner on Jul 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
it
executable file
·71 lines (58 loc) · 1.48 KB
/
it
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
#!/usr/bin/env bash -euE
# provides the main interface of the script utilities
# dependent on ./scripts/_confiture
IFS=$'\n\t'
source "$(dirname "$0")/scripts/_configure"
_help() {
cat <<FIN
it is the main interface of script utilities (macOS only)
content build content
build build content & source
run just run the compiled application
all build and then run
path just print the content paths
FIN
}
_content() {
# xnb files (not handled)
# cd "${_ROOT}/${_CONTENT_PROJ}"
# msbuild /t:BuildContent
_tmp=/tmp/it_content_file_xxx
_RUN pathgen > "${_tmp}"
mv "${_tmp}" "${_ROOT}/${_CONTENT_DEST}"
}
_build() {
_REQUIRE msbuild
cd "${_ROOT}"
msbuild "${_SLN}" "/p:configuration=Debug" "/p:platform=Any CPU" "/t:build"
}
_run() {
_REQUIRE mono
cd "${_ROOT}"
env "DYLD_LIBRARY_PATH=${_ROOT}/${_EXEC_PROJ}/bin/Debug/osx/" mono "${_ROOT}/${_EXEC_PROJ}/bin/Debug/${_EXEC_PROJ}.exe"
}
[ $# -eq 0 ] && _help && exit 0
_main() {
_cmd="${1}"
shift 1
case "${_cmd}" in
'b' | 'build')
_content "$@" &
_build "$@" ;;
'c' | 'content')
_content "$@" ;;
'r' | 'run')
_run "$@" ;;
'a' | 'all')
_content "$@" &
_build "$@"
_run "$@" ;;
'p' | 'path')
./scripts/pathgen ;;
'h' | 'help')
_help ;;
*)
echo "no matching command: \`${_cmd}\`" ;;
esac
}
_main "$@"