-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
84 lines (73 loc) · 2.64 KB
/
build.sh
File metadata and controls
84 lines (73 loc) · 2.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# ================================================================
# GCodePlotter — Build-Skript (macOS / Linux)
# Kompatibel mit Processing 4.x und 3.x
# ================================================================
set -e
PROCESSING_CORE_JAR=""
# Processing 4.x — core-4.x.x.jar
# Processing 3.x — core.jar
SEARCH_PATHS=(
# macOS — Processing 4
"/Applications/Processing.app/Contents/Java/core/library/core-4.5.2.jar"
"/Applications/Processing.app/Contents/Java/core/library/core-4.3.jar"
"/Applications/Processing.app/Contents/Java/core/library/core-4.0.jar"
# macOS — Processing 4 (generisch, alle Versionen)
"/Applications/Processing.app/Contents/Java/core/library/core-4"*.jar
# macOS — Processing 3
"/Applications/Processing.app/Contents/Java/core/library/core.jar"
# macOS user-lokal
"$HOME/Applications/Processing.app/Contents/Java/core/library/core-4"*.jar
"$HOME/Applications/Processing.app/Contents/Java/core/library/core.jar"
# Linux
"/usr/share/processing/core/library/core-4"*.jar
"/usr/share/processing/core/library/core.jar"
"$HOME/processing-4*/core/library/core-4"*.jar
"$HOME/processing-3*/core/library/core.jar"
# Manuell abgelegtes JAR im lib/ Ordner
"lib/core-4.5.2.jar"
"lib/core.jar"
)
for path in "${SEARCH_PATHS[@]}"; do
for expanded in $path; do
if [ -f "$expanded" ]; then
PROCESSING_CORE_JAR="$expanded"
break 2
fi
done
done
if [ -z "$PROCESSING_CORE_JAR" ]; then
echo ""
echo " ❌ core.jar / core-4.x.x.jar nicht gefunden!"
echo ""
echo " Lösung: Kopiere das JAR aus deiner Processing-Installation in den lib/ Ordner:"
echo ""
echo " Processing 4.x (macOS):"
echo " cp /Applications/Processing.app/Contents/Java/core/library/core-4.5.2.jar lib/"
echo ""
echo " Processing 3.x (macOS):"
echo " cp /Applications/Processing.app/Contents/Java/core/library/core.jar lib/"
echo ""
exit 1
fi
echo " ✓ core JAR gefunden: $PROCESSING_CORE_JAR"
mkdir -p bin
mkdir -p GCodePlotter/library
echo " → Kompiliere (Java 17)..."
javac -source 17 -target 17 \
-encoding UTF-8 \
-classpath "$PROCESSING_CORE_JAR" \
-d bin \
src/gcodeplotter/GCodePlotter.java \
src/gcodeplotter/PlotPath.java
echo " → Erzeuge GCodePlotter.jar..."
jar cf GCodePlotter/library/GCodePlotter.jar -C bin .
cp library.properties GCodePlotter/
cp -r examples GCodePlotter/
echo ""
echo " ✅ Build erfolgreich!"
echo ""
echo " Library installieren:"
echo " cp -r GCodePlotter ~/Documents/Processing/libraries/"
echo " → Processing neu starten"
echo ""