-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sh
executable file
·40 lines (31 loc) · 861 Bytes
/
build.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
#!/bin/bash
get_version_from_pom() {
grep -ioh -m 1 "<version>.*</version>" pom.xml | sed "s/<version>//g" | sed "s/<\/version>//g"
}
cd "$(dirname "$0")"
pom=pom.xml
[ ! -z "$1" ] && pom=$1
rm -rf dist
mkdir -p dist/sqlbrowserfx/lib
mvn clean package -f $pom
if [ $? -ne 0 ]
then
echo "Error : could not package project!"
exit 1
fi
mvn dependency:copy-dependencies
if [ $? -ne 0 ]
then
echo "Error : could not download dependencies!"
exit 2
fi
cp target/sqlbrowserfx*.jar dist/sqlbrowserfx/sqlbrowserfx.jar
cp target/dependency/* dist/sqlbrowserfx/lib
cp log4j.properties dist/sqlbrowserfx/
cp sqlbrowser-for-build.db dist/sqlbrowserfx/sqlbrowser.db
cp starters/* dist/sqlbrowserfx/
cp sqlbrowserfx.properties dist/sqlbrowserfx/
version=$(get_version_from_pom)
chmod +x dist/sqlbrowserfx/*.sh
cd dist
tar -czvf sqlbrowserfx-$version.tar.gz *