-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.bat
50 lines (41 loc) · 1.03 KB
/
make.bat
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
@ECHO OFF
SET cc=javac
SET cflags=
SET src=src
SET lib=lib
SET res=resources
SET out=bin
SET dist="Intelligent Client.jar"
CALL :clean 2>NUL
CALL "%res%\FindJDK.bat"
SET lstf=temp.txt
SET imgdir=%res%\images
SET manifest=%res%\Manifest.txt
FOR /F %%G IN (%versionfile%) DO SET version=%%G
ECHO Compiling bot
IF EXIST "%lstf%" DEL /F /Q "%lstf%"
FOR /F "usebackq tokens=*" %%G IN (`DIR /B /S "%src%\*.java"`) DO CALL :append "%%G"
IF EXIST "%out%" RMDIR /S /Q "%out%" > NUL
MKDIR "%out%"
"%cc%" %cflags% -d "%out%" "@%lstf%" 2>NUL
DEL /F /Q "%lstf%"
ECHO Packing JAR
IF EXIST "%dist%" DEL /F /Q "%dist%"
IF EXIST "%lstf%" DEL /F /Q "%lstf%"
COPY "%manifest%" "%lstf%"
ECHO Specification-Version: "%version%" >> "%lstf%"
ECHO Implementation-Version: "%version%" >> "%lstf%"
jar cfm "%dist%" "%lstf%" -C "%out%" . %res%\version.txt %imgdir%\*.png %res%\*.bat %res%\*.sh
DEL /F /Q "%lstf%"
:end
CALL :clean 2>NUL
ECHO Compilation successful.
GOTO :eof
:append
SET gx=%1
SET gx=%gx:\=\\%
ECHO %gx% >> %lstf%
GOTO :eof
:clean
RMDIR /S /Q "%out%"
GOTO :eof