From 1397f4b8eed1fec7de6628fa51709b2ac098e797 Mon Sep 17 00:00:00 2001 From: DevSnaith <65865554+DevSnaith@users.noreply.github.com> Date: Fri, 14 Apr 2023 07:26:04 +0300 Subject: [PATCH] Create compile method --- compile.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 compile.sh diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..799914c --- /dev/null +++ b/compile.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +which javac &> /dev/null +if [ ! $? -eq 0 ]; then + echo "Need javac to compile the project" + exit 1 +fi + +if [ ! -d "./build" ]; then + echo "Creating ./build Folder" + mkdir ./build + if [ $? -eq 0 ]; then + echo "./build has been created" + fi +fi + +echo "Generating source..." +SOURCE=$(find ./src/ | grep ".java") +echo $SOURCE | tr " " "\n" +echo "Start compiling..." +javac -verbose $SOURCE -d ./build +echo "Generating jar file..." +jar cvfe lumiere-server.jar org/eu/lumiere/Lumiere -C build . + +if [ -f ./lumiere-server.jar ]; then + echo "lumiere-server jar hes been created" +fi +