From 8d01716d9392b4479d51b546c501a559be32b81c Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Sat, 15 Feb 2025 00:09:21 +0100 Subject: [PATCH] Refactor package script to simplify JAR creation and archive process --- packaging/package.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packaging/package.sh b/packaging/package.sh index f3558ac..29607bd 100755 --- a/packaging/package.sh +++ b/packaging/package.sh @@ -102,9 +102,7 @@ fi # --- Add Class-Path to Manifest --- echo "Adding Class-Path to Manifest" -LIB_PATHS=$(find "${TEMP_DIR}/lib" -name '*.jar' | paste -sd' ') -echo "LIB_PATHS: ${LIB_PATHS}" -echo "Class-Path: lib/* ${LIB_PATHS}" >>"${MANIFEST_LOCATION}" # Adjusted Class-Path to be relative to JAR +#echo "Class-Path: . lib/*" >>"${MANIFEST_LOCATION}" # Add standard lib path to manifest # --- Create JAR file --- echo "" @@ -112,7 +110,7 @@ echo "Creating jar at location: ${JAR_LOCATION}" cd "${TEMP_DIR}" || exit # Change to temp dir for JAR command -jar cfm "${OUTPUT_JAR_DIR}/ATCS.jar" "${MANIFEST_LOCATION}" -C . com/gpl/rpg/atcontentstudio/ lib +jar cfm "${OUTPUT_JAR_DIR}/ATCS.jar" "${MANIFEST_LOCATION}" -C . . if [ $? -ne 0 ]; then echo "JAR creation failed." @@ -124,13 +122,11 @@ cd "${PACKAGING_DIR}" || exit # Go back to packaging dir echo '' echo "Done creating jar at ${OUTPUT_JAR_DIR}/ATCS.jar" -cp "${OUTPUT_JAR_DIR}/ATCS.jar" "${OUTPUT_JAR_DIR}" - # --- Create archive --- if [ "$PLATFORM" = "LINUX" ]; then cd "${OUTPUT_JAR_DIR}" || exit echo "Creating archive" - tar caf "ATCS_${VERSION}.tar.gz" "common" # archive the 'common' folder which now contains the JAR and libs + tar caf "ATCS_${VERSION}.tar.gz" * # archive the 'common' folder which now contains the JAR and libs echo "Created archive at ${OUTPUT_JAR_DIR}/ATCS_${VERSION}.tar.gz" cd "${PACKAGING_DIR}" || exit else