-
Notifications
You must be signed in to change notification settings - Fork 4
/
CreateMarsJar.sh
executable file
·30 lines (24 loc) · 1.07 KB
/
CreateMarsJar.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
#!/usr/bin/env bash
if type -p java; then
echo "Found Java executable in PATH"
_java=java
elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
echo "Found Java executable in JAVA_HOME"
_java="$JAVA_HOME/bin/java"
else
echo "Could not find an installation of Java"
fi
if [[ "$_java" ]]; then
version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')
echo "version $version"
IFS=. read major minor extra <<< "$version";
if ((major > 9 || (major == 1 && minor > 9))); then
echo "Compiling Mars with default javac"
find . -name "*.java" | xargs javac
else
echo "Attempting to compile Mars with java-10"
find . -name "*.java" | xargs /usr/lib/jvm/java-10/bin/javac
fi
fi
jar cfm Mars.jar META-INF/MANIFEST.MF README.md LICENSE.md PseudoOps.txt Config.properties Syscall.properties Settings.properties MipsXRayOpcode.xml registerDatapath.xml controlDatapath.xml ALUcontrolDatapath.xml CreateMarsJar.bat CreateMarsJar.sh Mars.java Mars.class docs help images mars
echo "CreateMarsJar finished"