-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake.bat
More file actions
111 lines (95 loc) · 2.31 KB
/
Copy pathmake.bat
File metadata and controls
111 lines (95 loc) · 2.31 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@echo off
set initialPath=%cd%
set zip=%programFiles%\7-Zip\7z.exe
set nsis=%ProgramFiles(x86)%\NSIS\makensis.exe
IF "%~1" == "" goto help
if %1==help goto help
if %1==clean goto clean
if %1==open goto open
if %1==jar goto jar
if %1==portable goto portable
if %1==installer goto installer
if %1==full goto full
:help
echo Available parameters
echo make help - Display this help
echo make clean <all> - Cleans the build system (add "all" to also remove ./release/output/
echo make open - Opens release folder
echo make jar - Create the jar in ./build/libs/
echo make portable - Zip the windows version up as the portable release
echo make installer - Create an installer from the windows version
echo make full - Build all three versions
goto exit
:clean
echo Cleaning...
if "%~2" == "all" (
if exist release\ RMDIR /S /Q release\
) else (
if exist release\raw\ RMDIR /S /Q release\raw\
)
call jvm-creator/make clean
call exe-creator/make clean
call gradlew clean
echo Done!
goto :EOF
:open
if exist release\ (
echo Opening release folder
%SystemRoot%\explorer.exe "release"
) else (
echo Release folder does not exist. Try "make full" first
)
goto :EOF
:compileJar
set /p type=Jar Release type:
call gradlew build -Dtype=%type%
goto :EOF
:jar
call :clean
echo Compiling jar...
call :compileJar
call :prepare
cd release\raw\
echo Moving jar...
xcopy SnipSniper.jar ..\output\ > nul
cd %initialPath%
goto :EOF
:portable
echo Creating portable...
call :clean
call :compileJar
call exe-creator/make build WIN
call jvm-creator/make build
call :prepare
cd release\raw\
"%zip%" a ..\output\SnipSniper_Portable_Win.zip *
cd %initialPath%
goto :EOF
:installer
echo Creating installer...
call :clean
call :compileJar
call exe-creator/make build WIN_INSTALLED
call jvm-creator/make build
call :prepare
if not exist release\output\ (
mkdir release\output\
)
"%nsis%" nsis-installer.nsi
goto :EOF
:prepare
echo Preparing files...
mkdir release
robocopy jvm-creator/output/jdk/ release/raw/SnipSniper/jdk/ /E > nul
robocopy exe-creator/output/ release/raw/ /E > nul
xcopy build\libs\SnipSniper.jar release\raw\ > nul
echo Done preparing files
goto :EOF
:full
call :clean all
call :jar
call :portable
call :installer
goto exit
:exit
echo Exiting...