-
Notifications
You must be signed in to change notification settings - Fork 3
/
build-controller.sh
executable file
·58 lines (37 loc) · 1.09 KB
/
build-controller.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
#!/bin/bash
#get working directory
HOME=`pwd`
CONFIG_FILE=mission.config
CONTROLLER_DIR=UNDERSEA_Controller
BUILD_DIR="$HOME/build"
#-------------------------------------------------------------------
# Part 1: Create build directory if does not exist
#-------------------------------------------------------------------
if [ ! -d "$BUILD_DIR" ]; then
mkdir build
fi
#-------------------------------------------------------------------
# Part 2: Create the controller
#-------------------------------------------------------------------
printf "\nCreating UUV controller in $BUILD_DIR\n"
#go to initial directory & then to controller's directory
cd $CONTROLLER_DIR
mvn clean package
JAR="target/UNDERSEA_Controller.jar"
if [ -e "$JAR" ]; then
cp $JAR $BUILD_DIR/
fi
if [ ! -d "$BUILD_DIR/resources" ]; then
cp -r resources $BUILD_DIR/
fi
printf "\nUUV controller created successfully in $BUILD_DIR\n"
cd $HOME
#PCM-based controller
cd $CONTROLLER_DIR
if [ ! -d "$BUILD_DIR/models" ]; then
cp -r models $BUILD_DIR/
fi
#if [ ! -d "$BUILD_DIR/repo" ]; then
cp -r repo $BUILD_DIR/
#fi
cd $HOME