forked from TheCoopNetwork/GMD-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.sh
executable file
·102 lines (88 loc) · 2.91 KB
/
compile.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/sh
skip_desktop=0
help()
{
echo "Parameters:"
echo
echo " --skip-desktop : Do not compile desktop classes."
exit
}
while [ "$1" != "" ]; do
case $1 in
--skip-desktop ) skip_desktop=1
;;
* ) help
;;
esac
shift
done
if [ -x jdk/bin/java ]; then
JAVA=./jdk/bin/java
JAVAC=./jdk/bin/javac
JAR=./jdk/bin/jar
else
JAVA=java
JAVAC=javac
JAR=jar
fi
PATHSEP=":"
if [ "$OSTYPE" = "cygwin" ] ; then
PATHSEP=";"
fi
CP="lib/*${PATHSEP}classes${PATHSEP}javafx-sdk/lib/*"
SP=src/java/
APPLICATION="CoopNetwork"
/bin/rm -f ${APPLICATION}.jar
/bin/rm -f ${APPLICATION}service.jar
/bin/rm -rf classes
/bin/mkdir -p classes/
/bin/rm -rf addons/classes
/bin/mkdir -p addons/classes/
echo "compiling core..."
find src/java/nxt/ -name "*.java" > sources.tmp
${JAVAC} -encoding utf8 -sourcepath "${SP}" -classpath "${CP}" -d classes/ @sources.tmp || exit 1
echo "core class files compiled successfully"
if [ $skip_desktop -eq 0 ]; then
echo "compiling desktop..."
find src/java/nxtdesktop/ -name "*.java" > sources.tmp
${JAVAC} --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.web -encoding utf8 -sourcepath "${SP}" -classpath "${CP}" -d classes/ @sources.tmp
if [ $? -eq 0 ]; then
echo "desktop class files compiled successfully"
else
echo "if javafx is not supported, desktop compile errors are safe to ignore, but desktop wallet will not be available"
echo "Tip: You can disable compilation of the desktop using --skip-desktop"
fi
fi
rm -f sources.tmp
find addons/src/ -name "*.java" > addons.tmp
if [ -s addons.tmp ]; then
echo "compiling add-ons..."
${JAVAC} -encoding utf8 -sourcepath "${SP}${PATHSEP}addons/src" -classpath "${CP}${PATHSEP}addons/classes${PATHSEP}addons/lib/*" -d addons/classes @addons.tmp || exit 1
echo "add-ons compiled successfully"
else
echo "no add-ons to compile"
fi
rm -f addons.tmp
find test/java/ -name "*.java" > tests.tmp
if [ -s tests.tmp ]; then
echo "compiling tests..."
/bin/rm -rf test/classes
/bin/mkdir -p test/classes/
${JAVAC} -encoding utf8 -sourcepath "${SP}${PATHSEP}test/java${PATHSEP}addons/test/java" -classpath "${CP}${PATHSEP}addons/classes${PATHSEP}testlib/*" -d test/classes @tests.tmp || exit 1
echo "tests compiled successfully"
else
echo "no tests to compile"
fi
rm -f tests.tmp
find installer/panels/src -name "*.java" > panels.tmp
if [ -s panels.tmp ]; then
echo "compiling installer panels..."
/bin/rm -rf installer/panels/classes
/bin/mkdir -p installer/panels/classes/
${JAVAC} -encoding utf8 -sourcepath "installer/panels/src" -classpath "${CP}${PATHSEP}installer/lib/*" -d installer/panels/classes @panels.tmp || exit 1
echo "installer panels compiled successfully"
else
echo "no installer panels to compile"
fi
rm -f panels.tmp
echo "compilation done"