-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
59 lines (46 loc) · 1.42 KB
/
build.bat
File metadata and controls
59 lines (46 loc) · 1.42 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
@echo off
setlocal enabledelayedexpansion
REM Check if Java is installed
java -version >nul 2>&1
if %errorlevel% neq 0 (
echo Java is not installed or not in PATH. Please install Java and try again.
pause
exit /b 1
)
REM Detect Java version (major only)
for /f "tokens=3" %%i in ('java -version 2^>^&1 ^| findstr /i "version"') do (
set "JAVA_VERSION=%%~i"
)
REM Strip quotes and split major version
set "JAVA_VERSION=%JAVA_VERSION:"=%"
for /f "tokens=1 delims=." %%j in ("%JAVA_VERSION%") do (
set "JAVA_MAJOR=%%j"
)
REM Proceed with build
echo Building JTabViz...
if not exist out (
mkdir out
)
echo Copying resources...
xcopy /E /I /Y resources\graphics out\graphics >nul
xcopy /E /I /Y resources\icons out\icons >nul
if exist README.md (
copy README.md out\ >nul
)
echo Compiling Java files using --release %JAVA_MAJOR%...
javac --enable-preview --release %JAVA_MAJOR% -d out -cp "libs/*" src/Main.java src/classifiers/*.java src/utils/*.java src/managers/*.java src/table/*.java src/plots/*.java src/*.java
if %errorlevel% neq 0 (
echo Compilation failed.
pause
exit /b %errorlevel%
)
echo Main-Class: src.Main> out\MANIFEST.MF
echo Creating JAR file...
jar cfm out\JTabViz.jar out\MANIFEST.MF -C out .
if %errorlevel% neq 0 (
echo JAR creation failed.
pause
exit /b %errorlevel%
)
echo Build successful! Running application...
start /min java --enable-preview -jar out\JTabViz.jar