-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh.command
More file actions
executable file
·47 lines (42 loc) · 947 Bytes
/
run.sh.command
File metadata and controls
executable file
·47 lines (42 loc) · 947 Bytes
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
#!/bin/bash
#####################
# Run Java Snippets #
# WTFPL #
#####################
banner="Java Snippets - Run"
projectHome=$(cd $(dirname $0); pwd)
displayIntro() {
cd $projectHome
echo
echo $banner
echo $(echo $banner | sed s/./=/g)
pwd
which java || exit
java --version
echo
}
buildClassFiles() {
cd $projectHome
echo "Building..."
rm -rf build
javac -d build src/*.java src/library/*.java
ls -1 build/javasnippets/*.class
cp data/countries.xsd build/javasnippets #for XmlValidator, see: https://stackoverflow.com/q/16570523
echo
}
runSnippets() {
cd $projectHome/build
echo "Running..."
pwd
echo
for file in ../src/*.java; do
name=$(basename $file .java)
echo "-------------------------------------------------------"
echo "$ java $name"
java javasnippets/$name
echo
done
}
displayIntro
buildClassFiles
runSnippets