From f1e5c7807ffa08871a26463071251a97aa69561f Mon Sep 17 00:00:00 2001 From: gsidhwani_nr Date: Fri, 18 Oct 2024 15:35:21 +0530 Subject: [PATCH] fix: added local jar build script --- custom-log4j2-appender/build-local.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 custom-log4j2-appender/build-local.sh diff --git a/custom-log4j2-appender/build-local.sh b/custom-log4j2-appender/build-local.sh new file mode 100755 index 0000000..c85c7d8 --- /dev/null +++ b/custom-log4j2-appender/build-local.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# clean existing stuff +rm -rf build io +# copy correct build.gradle +cp build-shadowJar.gradle build.gradle + +# Get the current directory (assuming the script is run from the custom-log4j2-appender directory) +CURRENT_DIR=$(pwd) +PROJECT_ROOT=$(dirname "$CURRENT_DIR") + +echo "Current Directory: $CURRENT_DIR" +echo "Project Root: $PROJECT_ROOT" + +# Clean and build the project +cd "$PROJECT_ROOT" +./gradlew clean build shadowJar + +# Navigate to the directory containing the artifacts +cd "$CURRENT_DIR/build/libs" + +# List the contents of the build/libs directory for debugging +echo "Contents of build/libs:" +ls -la + +echo "Local jar custom-log4j2-appender.jar is produced. You can now copy custom-log4j2-appender.jar to your applications classpath ."