This repository has been archived by the owner on May 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure
77 lines (64 loc) · 1.71 KB
/
configure
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
#!/bin/bash
PKG_BASE="io/kamax"
SRV_BASE_DIR="../server"
SRV_BASE_SRC_DIR="$SRV_BASE_DIR/src"
SRV_PKG_BASE_NAME="hboxd"
CLT_BASE_DIR="../client"
CLT_BASE_SRC_DIR="$CLT_BASE_DIR/src"
CLT_API_BASE_DIR="$CLT_BASE_SRC_DIR/api"
CLT_CORE_BASE_DIR="$CLT_BASE_SRC_DIR/core"
CLT_GUI_BASE_DIR="$CLT_BASE_SRC_DIR/gui"
SRV_API_BASE_DIR="$SRV_BASE_SRC_DIR/api"
SRV_CORE_BASE_DIR="$SRV_BASE_SRC_DIR/core"
err() {
echo -e >&2 "\e[1;31m$1\e[m $2"
exit 1
}
isInPath() {
hash "$1" 2> /dev/null
return $?
}
ok() {
echo -e "\e[1;32mOK\e[m"
}
checkForCommand() {
echo -n "checking for $2... "
if isInPath "$1"
then ok
else err "Not found!" "Adapt your PATH to include $1"
fi
}
checkForDirectory() {
echo -n "checking for path to $2... "
if [ -d "$1" ]
then ok
else err "Not found!" "$1"
fi
}
echo
echo "---------------------------------------"
echo " Hyperbox "
echo " Configuration script for build "
echo "---------------------------------------"
echo
checkForCommand git Git
checkForCommand ant Ant
checkForDirectory "$CLT_API_BASE_DIR" "Client API"
checkForDirectory "$CLT_CORE_BASE_DIR" "Client Core"
checkForDirectory "$CLT_GUI_BASE_DIR" "Client GUI"
checkForDirectory "$SRV_API_BASE_DIR" "Server API"
checkForDirectory "$SRV_CORE_BASE_DIR" "Server Core"
echo
echo -n "Writting setting file... "
echo "# General config file" > build.properties
echo "client.base.dir=$CLT_BASE_DIR" >> build.properties
echo "client.dir=$CLT_BASE_SRC_DIR" >> build.properties
echo "server.base.dir=$SRV_BASE_DIR" >> build.properties
echo "server.dir=$SRV_BASE_SRC_DIR" >> build.properties
ok
echo
echo "==============================="
echo "Finished configuring. Now run the following:"
echo
echo -e "\tant"
echo