-
Notifications
You must be signed in to change notification settings - Fork 4
/
lemonpatterns
executable file
·49 lines (38 loc) · 1.33 KB
/
lemonpatterns
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
#!/bin/bash
if [[ -z "$LEMONPATTERNS_HOME" ]]
then
LEMONPATTERNS_HOME=.
fi
die () {
echo >&2 "$@"
exit 1
}
if [ $# -ne 1 ] && [ $# -ne 2 ]
then
die "Required argument: lexiconFile"
fi
if [ ! -d $LEMONPATTERNS_HOME/lib ]
then
mkdir lib
fi
if [ ! -e $LEMONPATTERNS_HOME/lib/scala-library-2.11.11.jar ]
then
echo "Obtaining Scala library"
wget http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.11/scala-library-2.11.11.jar -O lib/scala-library-2.11.11.jar || die "wget failed"
fi
if [ ! -e $LEMONPATTERNS_HOME/lib/scala-xml_2.11-1.0.6.jar ]
then
echo "Obtaining Scala library"
wget http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.6/scala-xml_2.11-1.0.6.jar -O lib/scala-xml_2.11-1.0.6.jar
fi
if [ ! -e $LEMONPATTERNS_HOME/lib/jflex-1.4.3.jar ]
then
echo "Obtaining JFlex"
wget http://repo1.maven.org/maven2/de/jflex/jflex/1.4.3/jflex-1.4.3.jar -O lib/jflex-1.4.3.jar || die "wget failed"
fi
if [ ! -e $LEMONPATTERNS_HOME/target/lemon.patterns_2.11.11-1.17.6.jar ]
then
echo "Compiling sources"
mvn install || die "Maven failed"
fi
java -cp $LEMONPATTERNS_HOME/lib/scala-xml_2.11-1.0.6.jar:$LEMONPATTERNS_HOME/lib/scala-library-2.11.11.jar:$LEMONPATTERNS_HOME/lib/jflex-1.4.3.jar:$LEMONPATTERNS_HOME/target/lemon.patterns_2.11.11-1.17.6.jar net.lemonmodel.patterns.ConvertPatterns "$@"