-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbootstrap
executable file
·32 lines (32 loc) · 1.51 KB
/
bootstrap
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
#!/bin/bash
JDEPEN_LOC=./3rdparty/jdepend
JSCH_LOC=./3rdparty/jsch/lib
JSCH=${JSCH_LOC}/jsch-0.1.55.jar
JAVA_HOME=$(type -p java|xargs readlink -f|xargs dirname|xargs dirname)
mkdir -p "$JSCH_LOC"
mkdir -p "${JDEPEN_LOC}/lib"
echo "compile JDepend"
$JAVA_HOME/bin/javac -sourcepath $JDEPEN_LOC/src/java -d $JDEPEN_LOC/lib $JDEPEN_LOC/src/java/jdepend/framework/*.java
rc=$?; if [ $rc != 0 ]; then exit $rc; fi
mkdir -p lib
if [ ! -e "$JSCH" ]; then
curl --output "$JSCH" https://repo1.maven.org/maven2/com/jcraft/jsch/0.1.55/jsch-0.1.55.jar
rc=$?; if [ $rc != 0 ]; then echo "Cant'd download jsch-0.1.53.jar, check Internet connection"; exit $rc; fi
fi
echo "compile 7Bee"
echo ./lib:$JDEPEN_LOC/lib:$JSCH
timestamp=$(date +"%c")
echo "package org.bee; public class CompileStamp { public static final String getStamp() { return \"$timestamp\"; }}" > src/java/org/bee/CompileStamp.java
$JAVA_HOME/bin/javac -source 11 -target 11 -classpath ./lib:$JDEPEN_LOC/lib:$JSCH -sourcepath src/java -d lib src/java/org/bee/processor/*.java src/java/org/bee/util/*.java src/java/org/bee/oper/*.java src/java/org/bee/func/*.java
rc=$?; if [ $rc != 0 ]; then exit $rc; fi
echo "build result JAR"
$JAVA_HOME/bin/jar -cvmf ./manifest.mf lib/bee.jar -C lib org -C 3rdparty/jdepend/lib jdepend
rc=$?; if [ $rc != 0 ]; then exit $rc; fi
while true; do
read -p "Do you wish to install 7Bee?" yn
case $yn in
[Yy]* ) sudo java -jar ./lib/bee.jar install; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done