-
Notifications
You must be signed in to change notification settings - Fork 1
/
s_build
executable file
·101 lines (82 loc) · 3.81 KB
/
s_build
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
#!/bin/bash
# #########################################################################
# Build Script for BNGParser
# #########################################################################
echo ' '
echo ' '
echo ' '
echo ' This script should be called right after cloning the GitHub code.'
echo ' Building the parser before importing the code into Eclipse will'
echo ' ensure that Eclipse is using the right parser.'
echo ' '
#/bin/rm -r -f BNGParser
#git clone https://github.com/RuleWorld/BNGParser.git
cd src/bngparser/grammars
echo '-------------------------------------------------------------------'
echo ' Generate grammars'
echo '-------------------------------------------------------------------'
java -jar ../../antlr-3.3-complete.jar BNGLexer.g
java -jar ../../antlr-3.3-complete.jar BNGGrammar.g
echo '-------------------------------------------------------------------'
echo ' Compile grammars'
echo '-------------------------------------------------------------------'
cd ../..
for jfile in $(ls bngparser/grammars/*.java)
do
echo $jfile
javac -classpath bngparser/grammars:bngparser/methods:bngparser/models:bngparser/dataType:bngparser/exceptions:antlr-3.3-complete.jar:../commons-lang3-3.1.jar:. -sourcepath . $jfile
done
echo '-------------------------------------------------------------------'
echo ' Compiling methods '
echo '-------------------------------------------------------------------'
for jfile in $(ls bngparser/methods/*.java)
do
echo $jfile
javac -classpath bngparser/grammars:bngparser/methods:bngparser/models:bngparser/dataType:bngparser/exceptions:antlr-3.3-complete.jar:../commons-lang3-3.1.jar:. -sourcepath . $jfile
done
echo '-------------------------------------------------------------------'
echo ' Compiling dataType '
echo '-------------------------------------------------------------------'
for jfile in $(ls bngparser/dataType/*.java)
do
echo $jfile
javac -classpath bngparser/grammars:bngparser/methods:bngparser/models:bngparser/dataType:bngparser/exceptions:antlr-3.3-complete.jar:../commons-lang3-3.1.jar:. -sourcepath . $jfile
done
echo '-------------------------------------------------------------------'
echo ' Compiling exceptions '
echo '-------------------------------------------------------------------'
for jfile in $(ls bngparser/exceptions/*.java)
do
echo $jfile
javac -classpath bngparser/grammars:bngparser/methods:bngparser/models:bngparser/dataType:bngparser/exceptions:antlr-3.3-complete.jar:../commons-lang3-3.1.jar:. -sourcepath . $jfile
done
echo '-------------------------------------------------------------------'
echo ' Compiling bngparser '
echo '-------------------------------------------------------------------'
for jfile in $(ls bngparser/*.java)
do
if [ $jfile != 'bngparser/MCellTranslatorTester.java' ];
then
if [ $jfile != 'bngparser/Tester.java' ];
then
echo $jfile
javac -classpath bngparser/grammars:bngparser/methods:bngparser/models:bngparser/dataType:bngparser/exceptions:antlr-3.3-complete.jar:../commons-lang3-3.1.jar:. -sourcepath . $jfile
fi
fi
done
echo '-------------------------------------------------------------------'
echo ' Creating jar '
echo '-------------------------------------------------------------------'
cp ../xml.stg .
jar cf BNGParser.jar bngparser xml.stg
echo '-------------------------------------------------------------------'
echo ' Running tests '
echo '-------------------------------------------------------------------'
cp ../commons-lang3-3.1.jar .
javac -cp antlr-3.3-complete.jar:BNGParser.jar:commons-lang3-3.1.jar:. \
bngparser/Tester.java
java -cp antlr-3.3-complete.jar:BNGParser.jar:commons-lang3-3.1.jar:. \
bngparser/Tester
echo '-------------------------------------------------------------------'
echo ' Done '
echo '-------------------------------------------------------------------'