-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmake.cmd
143 lines (116 loc) · 4.07 KB
/
make.cmd
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@setlocal && echo off
@REM ----------------------------------------------------------------------------
@REM make.cmd
@REM
@REM This script runs the various tasks of the TealsMC project. Supply any
@REM combination of the following keywords:
@REM
@REM clean - delete all generated files
@REM
@REM dev-setup - Set up Forge for project development
@REM
@REM build - Build the distributable project archive file in
@REM out/TealsMC.zip.
@REM
@REM fresh = clean + build
@REM all = clean + build
@REM
@REM ----------------------------------------------------------------------------
if "%1" equ "" (
call :help
exit /b 0
)
:processTargets
set target=%1
if /i "%target%" equ "all" (
call :clean
call :build
) else if /i "%target%" equ "dev-setup" (
call :devSetup
) else if /i "%target%" equ "build" (
call :build
) else if /i "%target%" equ "clean" (
call :clean
) else if /i "%target%" equ "fresh" (
call :clean
call :build
) else if /i "%target%" equ "help" (
call :help
) else if /i "%target%" equ "/?" (
call :help
) else if /i "%target%" equ "-?" (
call :help
) else (
@echo ERROR: Unrecognized target ^(%target%^). 1>&2
call :help
)
shift
if "%1" neq "" goto :processTargets
:endLoop
exit /b 0
:clean
rmdir 2>nul: /s /q out
mkdir out
goto :eof
:devSetup
robocopy /mir build\skeleton\tealsmc src\forge\production\src\tealsmc
goto :eof
:build
call :check7z
echo errorlevel = %errorlevel%
if %errorlevel% neq 0 goto :eof
call :clean
set robocopy=robocopy /nfl /njh /njs
for /f "delims=" %%v in (version.txt) do (
set archiveBasename=tealsmc-%%v
)
@REM -- Eclipse Release
set archive=%archiveBasename%-eclipse
set dest=out\%archive%\TealsMC-Eclipse
%robocopy% /mir "build\ide\eclipse" %dest%
%robocopy% /mir "src\forge\production\lib" %dest%\Minecraft\production\lib
%robocopy% /mir "src\forge\production\src\org" %dest%\Minecraft\src\org
%robocopy% /mir "src\forge\production\resources" %dest%\Minecraft\resources
%robocopy% /mir "src\forge\production\lib\gradle\start" %dest%\Minecraft\launcher
%robocopy% /e /xo "build\skeleton" %dest%\Minecraft\src
copy build\README-Distrib.txt %dest%\README.txt
copy CHANGELOG.md %dest%
copy version.txt %dest%
pushd out\%archive%
call 7z a ..\%archive%.zip .
popd
@REM -- IntelliJ IDEA Release
set archive=%archiveBasename%-intellij
set dest=out\%archive%\TealsMC-IntelliJ
%robocopy% /mir "build\ide\intellij" %dest%\Forge
%robocopy% /mir "src\forge\production\lib" %dest%\Forge\production\lib
%robocopy% /mir "src\forge\production\src\org" %dest%\Forge\src\main\java\org
%robocopy% /mir "src\forge\production\resources" %dest%\Forge\src\main\resources
%robocopy% /mir "src\forge\production\lib\gradle\start" %dest%\Forge\production\lib\gradle\start
%robocopy% /e /xo "build\skeleton" %dest%\Forge\src\main\java
copy build\README-Distrib.txt %dest%\README.txt
copy CHANGELOG.md %dest%
copy version.txt %dest%
pushd out\%archive%
call 7z a ..\%archive%.zip .
popd
goto :eof
:check7z
@REM -- Ensure that the 7-zip command-line executable is available on the current path.
where /q 7z
if %errorlevel% neq 0 echo 1>&2ERROR: Executable 7z.exe not found.
goto :eof
:help
@echo.
@echo.This script runs the various tasks of the TealsMC project. Supply any
@echo.combination of the following keywords:
@echo.
@echo. clean - delete all generated files
@echo.
@echo. build - Build the distributable project archive file in
@echo. out/TealsMC.zip.
@echo.
@echo. fresh = clean + build
@echo. all = clean + build
@echo.
goto :eof