fixed linux/macos run script. added additional cli options to create jar, and redirected compiled classes to new bin directory
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
-6
@@ -2,15 +2,12 @@ function Run {
|
|||||||
param(
|
param(
|
||||||
[string]$flag
|
[string]$flag
|
||||||
)
|
)
|
||||||
javac *.java
|
javac -d bin *.java
|
||||||
java App $flag
|
java -cp bin App $flag
|
||||||
Remove-Item *.class
|
|
||||||
Remove-Item gui/*.class
|
|
||||||
Remove-Item gui/backend/*.class
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($args.Length -eq 1) {
|
if ($args.Length -eq 1) {
|
||||||
$flag = $args[0]
|
$flag = $args[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
Run $flag
|
Run $flag
|
||||||
|
|||||||
Regular → Executable
+30
-11
@@ -1,13 +1,32 @@
|
|||||||
run() {
|
function run() {
|
||||||
javac *.java
|
if [[ $# -eq 0 ]]; then
|
||||||
java App $1
|
# Compile the program
|
||||||
rm *.class
|
javac -d bin *.java
|
||||||
rm gui/*.class
|
java -cp bin App
|
||||||
rm gui/backend/*.class
|
else
|
||||||
|
case $1 in
|
||||||
|
"-c" | "--cli")
|
||||||
|
# Run the program in the CLI
|
||||||
|
# Compile the program
|
||||||
|
javac -d bin *.java
|
||||||
|
java -cp bin App -c
|
||||||
|
;;
|
||||||
|
|
||||||
|
"-b" | "--build")
|
||||||
|
# Compile the program
|
||||||
|
javac -d bin *.java
|
||||||
|
;;
|
||||||
|
|
||||||
|
"-j" | "--jar")
|
||||||
|
# Create a JAR file
|
||||||
|
jar cfe sudoku.jar App -C bin .
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Invalid argument"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if($# -eq 1) then
|
run $@
|
||||||
FLAG=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
run $FLAG
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user