Fix gradle and add workflows
Build and Test j3270 / Build JAR & Run Tests (push) Failing after 2m24s
Build and Test j3270 / Build JAR & Run Tests (push) Failing after 2m24s
This commit is contained in:
@@ -3,43 +3,14 @@
|
||||
# Usage: ./run.sh [host] [port] [model]
|
||||
# Example: ./run.sh mainframe.example.com 23 4
|
||||
|
||||
JAVA_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
BUILD_DIR="$JAVA_DIR/build"
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
BUILD_DIR="$SCRIPT_DIR/build"
|
||||
|
||||
# Always rebuild to pick up changes
|
||||
echo "Building lib3270j..."
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR/lib3270j" "$BUILD_DIR/j3270"
|
||||
# Build if jar is missing or rebuild requested
|
||||
if [ ! -f "$BUILD_DIR/j3270.jar" ]; then
|
||||
"$SCRIPT_DIR/build_all.sh"
|
||||
fi
|
||||
|
||||
# Compile libraries
|
||||
find "$JAVA_DIR/lib3270j/src" -name "*.java" -print0 | xargs -0 javac -d "$BUILD_DIR/lib3270j"
|
||||
|
||||
echo "Building j3270..."
|
||||
find "$JAVA_DIR/j3270/src" -name "*.java" -print0 | xargs -0 javac -cp "$BUILD_DIR/lib3270j" -d "$BUILD_DIR/j3270"
|
||||
|
||||
echo "Build complete."
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# NEW: Package the shareable JAR
|
||||
# ---------------------------------------------------------
|
||||
echo "Packaging j3270.jar..."
|
||||
|
||||
# 1. Create the Manifest file indicating the entry point
|
||||
# Note: The manifest file must end with a new line or carriage return
|
||||
echo "Main-Class: org.pubvm.j3270.J3270App" > "$BUILD_DIR/MANIFEST.MF"
|
||||
echo "" >> "$BUILD_DIR/MANIFEST.MF"
|
||||
|
||||
# 2. Build the JAR using both compiled directories
|
||||
jar cvfm "$BUILD_DIR/j3270.jar" "$BUILD_DIR/MANIFEST.MF" \
|
||||
-C "$BUILD_DIR/lib3270j" . \
|
||||
-C "$BUILD_DIR/j3270" .
|
||||
|
||||
echo "Executable JAR created at: $BUILD_DIR/j3270.jar"
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Run the newly packaged JAR
|
||||
# ---------------------------------------------------------
|
||||
#exec java -Dapple.laf.useScreenMenuBar=true \
|
||||
# -Dapple.awt.application.name=j3270 \
|
||||
# -jar "$BUILD_DIR/j3270.jar" "$@"
|
||||
nohup java -jar build/j3270.jar &
|
||||
exec java -Dapple.laf.useScreenMenuBar=true \
|
||||
-Dapple.awt.application.name=j3270 \
|
||||
-jar "$BUILD_DIR/j3270.jar" "$@"
|
||||
|
||||
Reference in New Issue
Block a user