-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·64 lines (53 loc) · 1.64 KB
/
setup.sh
File metadata and controls
executable file
·64 lines (53 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Eclipse Formatter CLI - Quick Setup Script
# One-line setup for users who just want to get started quickly
set -e
echo "🚀 Eclipse Formatter CLI - Quick Setup"
echo "======================================"
# Check if we're in the right directory
if [ ! -f "build.gradle" ]; then
echo "❌ Error: build.gradle not found in current directory"
echo "Please run this script from the project root directory"
exit 1
fi
# Make scripts executable
chmod +x gradlew install.sh eclipse-format.sh build.sh 2>/dev/null || true
# Check Java
if ! command -v java &> /dev/null; then
echo "❌ Java not found. Please install Java 15 or higher."
exit 1
fi
# Build the project
echo "🔨 Building project..."
./gradlew shadowJar
if [ $? -ne 0 ]; then
echo "❌ Build failed. Please check the error messages above."
exit 1
fi
# Create a simple wrapper in current directory
cat > eclipse-format << 'EOF'
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
exec java -jar "$SCRIPT_DIR/build/libs/eclipse-format.jar" "$@"
EOF
chmod +x eclipse-format
echo ""
echo "✅ Setup complete!"
echo ""
echo "You can now use the formatter in several ways:"
echo ""
echo "1. ${GREEN}From current directory:${NC}"
echo " ./eclipse-format --help"
echo ""
echo "2. ${GREEN}Using the universal wrapper:${NC}"
echo " ./eclipse-format.sh --help"
echo ""
echo "3. ${GREEN}Install system-wide:${NC}"
echo " ./install.sh"
echo ""
echo "4. ${GREEN}Direct JAR usage:${NC}"
echo " java -jar build/libs/eclipse-format.jar --help"
echo ""
echo "Example: ./eclipse-format -r src/"
echo ""
echo "For more installation options, run: ./install.sh"