21 lines
726 B
Bash
21 lines
726 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
# Set the project root directory
|
||
|
PROJECT_ROOT=$(dirname "$0")/..
|
||
|
|
||
|
# Clean all bin classes folders
|
||
|
rm -rf "$PROJECT_ROOT/src/Web/WEB-INF/classes"/*
|
||
|
|
||
|
# Clear the WEBApp dir contents
|
||
|
rm -rf "$PROJECT_ROOT/bin/Web App"/*
|
||
|
|
||
|
#find and compile all java files
|
||
|
find "$PROJECT_ROOT/src/source" -name "*.java" -exec javac -d "$PROJECT_ROOT/src/Web/WEB-INF/classes" -cp "$PROJECT_ROOT/src/Web/WEB-INF/lib/*:$PROJECT_ROOT/src/dependencies/*" {} +
|
||
|
|
||
|
# Copy the log4j.properties file from src to compiled classes location
|
||
|
cp -rf "$PROJECT_ROOT/src/source/log4j.properties" "$PROJECT_ROOT/src/Web/WEB-INF/classes"
|
||
|
|
||
|
# Copy all libs and config files to Web App dir
|
||
|
cp -rf "$PROJECT_ROOT/src/Web"/* "$PROJECT_ROOT/bin/Web App"
|