-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuildScript.sh
More file actions
executable file
·42 lines (30 loc) · 821 Bytes
/
buildScript.sh
File metadata and controls
executable file
·42 lines (30 loc) · 821 Bytes
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
#!/usr/bin/bash
# This script should be executed at the root of the project
# Requires java in the system
if [ ! -d "build" ]
then
echo "The build folder does not exist, creating..."
mkdir build
echo "The build folder was created"
else
echo "The build folder already exists"
fi
echo "Copying resources to build folder..."
cp -r lib/ build/
echo "Proceeding with compilation..."
javac src/*.java -d build
if [ $? -eq "0" ]
then
cd build
echo "Creating manifest (Manifest.txt)..."
echo "Class-Path: lib/mysql-connector-java-5.1.48.jar" >> Manifest.txt
echo "Main-Class: Main" >> Manifest.txt
echo "" >> Manifest.txt
jar cvfm JDBCExample.jar Manifest.txt .
mv JDBCExample.jar ../
cd ..
else
echo "Stopping here. Compilation failed"
fi
echo "Cleaning up build folder..."
rm -r build