From 8a37ae5317eb599f3420fca66697a7b6d687b3af Mon Sep 17 00:00:00 2001 From: Chopper1337 <43015696+Chopper1337@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:08:40 +0000 Subject: [PATCH 1/3] Add Makefile --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..751e8a272 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Define the variables: +DESTDIR=./dist +JAVA_OPTS= +MVN_CMD=mvn + +# Define the targets: +all: build test clean + +# define the rules for each target: +build: + @echo "Building project..." + $(MVN_CMD) package -DskipTests $(JAVA_OPTS) + +test: build + @echo "Running tests..." + $(MVN_CMD) test $(JAVA_OPTS) + +clean: + @echo "Cleaning project..." + rm -rf target/*.jar From 6c838374e82e121e02386b80e60e99f78697ac9c Mon Sep 17 00:00:00 2001 From: Chopper1337 <43015696+Chopper1337@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:32:12 +0000 Subject: [PATCH 2/3] Add help --- Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 751e8a272..e3638dc01 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,26 @@ # Define the variables: -DESTDIR=./dist +DESTDIR=dist JAVA_OPTS= MVN_CMD=mvn -# Define the targets: all: build test clean -# define the rules for each target: +# Build the application to the $DESTDIR folder build: @echo "Building project..." - $(MVN_CMD) package -DskipTests $(JAVA_OPTS) + $(MVN_CMD) install -DskipTests $(JAVA_OPTS) + mkdir -p $(DESTDIR) + mv ./target/*.jar $(DESTDIR)/ +# Build and test the application test: build @echo "Running tests..." $(MVN_CMD) test $(JAVA_OPTS) +# Clean the project folder, removing built binaries clean: @echo "Cleaning project..." - rm -rf target/*.jar + $(MVN_CMD) clean + +help: + @awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t From 403ad4c019287e4d080e653d643b31302ff4d1e1 Mon Sep 17 00:00:00 2001 From: Chopper1337 <43015696+Chopper1337@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:34:19 +0000 Subject: [PATCH 3/3] Add some output --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e3638dc01..31470b2a5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Define the variables: -DESTDIR=dist +DESTDIR=./dist JAVA_OPTS= MVN_CMD=mvn @@ -11,6 +11,7 @@ build: $(MVN_CMD) install -DskipTests $(JAVA_OPTS) mkdir -p $(DESTDIR) mv ./target/*.jar $(DESTDIR)/ + echo "Binary built to $(DESTDIR)" # Build and test the application test: build