Add build.sh install.sh run.sh

This commit is contained in:
Cametendo
2025-12-01 11:42:13 +01:00
parent 9d037b5a5b
commit 34ffa886c1
3 changed files with 45 additions and 0 deletions

13
scripts/build.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
VERSION="2.13.1"
echo "start building..."
set -e
mkdir -p out
javac -cp "lib/gson-${VERSION}.jar" -d out $(find Cards-Gate/src -name "*.java")
echo "build finished"

22
scripts/install.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -e
VERSION="2.13.1"
URL="https://search.maven.org/remotecontent?filepath=com/google/code/gson/gson/2.13.1/gson-2.13.1.jar"
LIB_DIR="./lib"
JAR_PATH="${LIB_DIR}/gson-${VERSIO}N.jar"
mkdir -p "$LIB_DIR"
if [ -f "$JAR_PATH" ]; then
echo "gson-${VERSION}.jar already exists"
else
echo "gson-${VERSION}.jar herunter"
curl -L "$URL" -o "$JAR_PATH"
echo "Download succesfull"
fi
echo "Installation done. You can now run build.sh"

10
scripts/run.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
MAIN_CLASS="Main"
VERSION="2.13.1"
echo "Running $MAIN_CLASS..."
java -cp "out:lib/gson-${VERSION}.jar" $MAIN_CLASS
echo "Finished running $MAIN_CLASS"