forked from yalov/CommNetAntennasConsumptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildRelease.bat
52 lines (39 loc) · 1.4 KB
/
buildRelease.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
51
52
@echo off
echo BUILDRELEASE.BAT
rem v5
rem Put the following text into the Post-build event command line:
rem without the "REM":
REM cd "$(SolutionDir)"
REM
REM call "$(SolutionDir)\buildDeploy.bat" "$(TargetDir)" "$(TargetFileName)"
REM
REM if $(ConfigurationName) == Release (
REM call "$(SolutionDir)\buildRelease.bat" "$(TargetDir)" "$(TargetFileName)"
REM )
rem Set variables here
set MODNAME=CommNetAntennasConsumptor
set LICENSE=%MODNAME%-License.txt
set CHANGELOG=ChangeLog.md
set VERSIONFILE=%MODNAME%.version
set RELEASESDIR=Releases
set ZIP="c:\Program Files\7-zip\7z.exe"
if "%LICENSE%" NEQ "" xcopy "%LICENSE%" "GameData\%MODNAME%" /Y /I /Q
if "%CHANGELOG%" NEQ "" xcopy "%CHANGELOG%" "GameData\%MODNAME%" /Y /I /Q
REM The following requires the JQ program, available here: https://stedolan.github.io/jq/download/
set JD="C:\Tools\jq-win64.exe"
%JD% ".VERSION.MAJOR" %VERSIONFILE% >tmpfile
set /P major=<tmpfile
%JD% ".VERSION.MINOR" %VERSIONFILE% >tmpfile
set /P minor=<tmpfile
%JD% ".VERSION.PATCH" %VERSIONFILE% >tmpfile
set /P patch=<tmpfile
%JD% ".VERSION.BUILD" %VERSIONFILE% >tmpfile
set /P build=<tmpfile
del tmpfile
set VERSION=%major%.%minor%.%patch%
if "%build%" NEQ "0" set VERSION=%VERSION%.%build%
echo Version: %VERSION%
set FILE="%RELEASESDIR%\%MODNAME%-v%VERSION%.zip"
IF EXIST %FILE% del /F %FILE%
%ZIP% a -tzip %FILE% GameData | findstr /I "archive everything"
rem pause