forked from Virtual-Universe/Virtual-Universe-Release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runprebuild.command
116 lines (102 loc) · 3.17 KB
/
runprebuild.command
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
#!/bin/bash
# Run prebuild to configure and create the appropriate Solution and Project files for building Virtual Universe
#
# Emperor Starfinder <[email protected]> for Virtual Universe - May 11, 2016
# Rowan Deppeler <[email protected]> for WhiteCore-Sim - March 2015
# find and change to the current folder (bash does not start here by default)
VUDIR="${0%/*}"
cd $VUDIR
echo $VUDIR
# default setings
ARCH="x64"
CONFIG="Debug"
BUILD=false
VERSIONONLY=false
USAGE="[-c <config>] -a <arch> -v"
LONG_USAGE="Configuration options to pass to prebuild environment
Options:
-c|--config Build configuration Debug (default) or Release
-a|--arch Architecture to target x86 or x64 (default)
-b|--build Build after configuration No (default) or Yes
-v|--version Update version details only
"
# get the current system architecture
if (( 1 == 1<<32 )); then
ARCH="x86";
echo "x86 architecture detected";
else
echo "x64 architecture found";
fi
# check if prompting needed
if [ $# -eq 0 ]; then
read -p "Architecture to use? (x86, x64) [$ARCH]: " bits
if [[ $bits == "x86" ]]; then ARCH="x86"; fi
if [[ $bits == "86" ]]; then ARCH="x86"; fi
if [[ $bits == "x64" ]]; then ARCH="x64"; fi
if [[ $bits == "64" ]]; then ARCH="x64"; fi
read -p "Configuration? (Release, Debug) [$CONFIG]: " conf
if [[ $conf == "Release" ]]; then CONFIG="Release"; fi
if [[ $conf == "release" ]]; then CONFIG="Release"; fi
bld="No"
if [[ $BUILD == true ]]; then bld="Yes"; fi
read -p "Build immediately? (Yes, No) [$bld]: " bld
if [[ $bld == "Yes" ]]; then BUILD=true; fi
if [[ $bld == "yes" ]]; then BUILD=true; fi
if [[ $bld == "y" ]]; then BUILD=true; fi
else
# command line params supplied
while case "$#" in 0) break ;; esac
do
case "$1" in
-c|--config)
shift
CONFIG="$1"
;;
-a|--arch)
shift
ARCH="$1"
;;
-b|--build)
BUILD=true
shift
;;
-v|--version)
VERSIONONLY=true
;;
-h|--help)
echo "$USAGE"
echo "$LONG_USAGE"
exit
;;
*)
echo "Illegal option!"
echo "$USAGE"
echo "$LONG_USAGE"
exit
;;
esac
shift
done
fi
# Configuring Virtual Universe
if ! ${VERSIONONLY:=true}; then
echo "Configuring Virtual Universe $ARCH $CONFIG build"
mono ./Prebuild.exe /target vs2010 /targetframework v4_5 /conditionals "LINUX;NET_4_5"
fi
# Update version info
if [ -d ".git" ]; then
git log --pretty=format:"Virtual Universe 1.0.2 (%cd.%h)" --date=short -n 1 > VirtualUniverse/bin/.version;
echo "Version info updated"
fi
# Build Virtual Universe
if ${BUILD:=true} ; then
echo Building Virtual Universe
xbuild Universe.sln /property:Configuration="$CONFIG" /property:Platform="$ARCH"
echo Finished Building Virtual Universe
echo Thank you for choosing Virtual Universe
echo Please report any errors to our Github Issue Tracker https://github.com/Virtual-Universe/Virtual-Universe/issues
echo You can also contact us in our galaxyfutures IRC channel on Freenode
else
echo "Virtual Universe has been configured to compile with $ARCH $CONFIG options"
echo "To manually build, enter 'xbuild Universe.sln' at the command prompt"
fi