-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
98 lines (81 loc) · 2.83 KB
/
build.bat
File metadata and controls
98 lines (81 loc) · 2.83 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
85
86
87
88
89
90
91
92
93
94
95
96
97
@echo off
REM ================================================================
REM GCodePlotter — Build-Skript (Windows)
REM Kompatibel mit Processing 4.x
REM ================================================================
REM ── Processing-internes JDK automatisch finden ──────────────────
REM Kein manueller PATH-Eintrag nötig.
set JAVAC=
set JAR_CMD=
REM Typische Processing 4.x JDK-Pfade
for %%P in (
"C:\Program Files\Processing\app\resources\jdk\bin"
"C:\Program Files\Processing 4\app\resources\jdk\bin"
"C:\Program Files (x86)\Processing\app\resources\jdk\bin"
"%LOCALAPPDATA%\Processing\app\resources\jdk\bin"
) do (
if exist "%%~P\javac.exe" (
set JAVAC="%%~P\javac.exe"
set JAR_CMD="%%~P\jar.exe"
echo JDK gefunden: %%~P
goto :found_jdk
)
)
REM Fallback: javac im System-PATH
where javac >nul 2>&1
if %errorlevel%==0 (
set JAVAC=javac
set JAR_CMD=jar
echo Verwende System-javac
goto :found_jdk
)
echo.
echo Fehler: javac nicht gefunden!
echo Stelle sicher dass Processing 4.x installiert ist unter:
echo C:\Program Files\Processing\
echo.
pause
exit /b 1
:found_jdk
REM ── core JAR suchen ─────────────────────────────────────────────
set PROCESSING_CORE_JAR=
if exist "C:\Program Files\Processing\app\core\library\core.jar" (
set PROCESSING_CORE_JAR=C:\Program Files\Processing\app\core\library\core.jar
)
if exist "C:\Program Files\Processing 4\app\core\library\core.jar" (
set PROCESSING_CORE_JAR=C:\Program Files\Processing 4\app\core\library\core.jar
)
if exist "lib\core-4.5.2.jar" set PROCESSING_CORE_JAR=lib\core-4.5.2.jar
if exist "lib\core.jar" set PROCESSING_CORE_JAR=lib\core.jar
if "%PROCESSING_CORE_JAR%"=="" (
echo.
echo Fehler: core JAR nicht gefunden!
echo Loesung: Kopiere das JAR in den lib\ Ordner:
echo C:\Program Files\Processing\app\core\library\core.jar → lib\core.jar
echo.
pause
exit /b 1
)
echo core JAR: %PROCESSING_CORE_JAR%
if not exist bin mkdir bin
if not exist GCodePlotter\library mkdir 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
if errorlevel 1 ( echo Fehler beim Kompilieren! & pause & exit /b 1 )
echo Erzeuge GCodePlotter.jar...
%JAR_CMD% cf GCodePlotter\library\GCodePlotter.jar -C bin .
copy library.properties GCodePlotter\
xcopy /s /e /i /y examples GCodePlotter\examples\ >nul
echo.
echo Build erfolgreich!
echo.
echo Library installieren:
echo %USERPROFILE%\Documents\Processing\libraries\GCodePlotter\
echo Processing neu starten.
echo.
pause