#!/bin/bash

# Gradle Wrapper Script
APP_HOME="$(cd "$(dirname "$0")" && pwd -P)"
GRADLE_WRAPPER_JAR="$APP_HOME/gradle/wrapper/gradle-wrapper.jar"

# Check if Java is available
if ! command -v java &> /dev/null; then
    echo "Error: Java is not installed or not in PATH"
    exit 1
fi

# Check if wrapper jar exists
if [ ! -f "$GRADLE_WRAPPER_JAR" ]; then
    echo "Error: Gradle wrapper jar not found at $GRADLE_WRAPPER_JAR"
    exit 1
fi

# Execute Gradle
exec java -classpath "$GRADLE_WRAPPER_JAR" org.gradle.wrapper.GradleWrapperMain "$@" 