seclore-java-sdk/examples/Java/5. Seclore Online Integrati.../Sample App/scripts/build.sh

24 lines
976 B
Bash

#!/bin/bash
set -e
# Set the project root directory
PROJECT_ROOT=$(dirname "$0")/..
# Clean all bin folders
rm -rf "$PROJECT_ROOT/source/WebContent/WEB-INF/classes"/*
rm -rf "$PROJECT_ROOT/bin"/*
#find and compile all java files
find "$PROJECT_ROOT/source/src" -name "*.java" -exec javac -d "$PROJECT_ROOT/source/WebContent/WEB-INF/classes" -cp "$PROJECT_ROOT/source/WebContent/WEB-INF/classes/lib/*" {} +
# Copy the log4j.properties file from src to compiled classes location
cp -rf "$PROJECT_ROOT/source/src/log4j.properties" "$PROJECT_ROOT/source/WebContent/WEB-INF/classes"
# mkdir "$PROJECT_ROOT/bin/SecloreOnlineIntegrationApp" if not present
mkdir -p "$PROJECT_ROOT/bin/SecloreOnlineIntegrationApp"
# Copy all libs and config files to Web App dir
cp -r "$PROJECT_ROOT/source/WebContent"/* "$PROJECT_ROOT/bin/SecloreOnlineIntegrationApp"
# zip the package
zip -r "$PROJECT_ROOT/bin/SecloreOnlineIntegrationApp.zip" "$PROJECT_ROOT/bin/SecloreOnlineIntegrationApp"/