-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmake_release.bat
92 lines (72 loc) · 3.15 KB
/
make_release.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
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
@ECHO OFF
REM Used to create a release package for Simpit
REM Arguments : ProjectDir OutDir
set ProjectDir=%1
set OutDir=%2
set "MyKSPDIR=%KSPDIR%"
if not defined MyKSPDIR (
echo KSPDIR is not set, I cannot make a release
exit /b 1
)
REM Read the version number
for /f "delims== tokens=1,2" %%G in (%ProjectDir%VERSION.txt) do set %%G=%%H
echo Version read %MAJOR%.%MINOR%.%PATCH%.%BUILD%
set OUTPUT_FOLDER="%ProjectDir%NextReleases\KerbalSimpitRevamped-v%MAJOR%.%MINOR%.%PATCH%\KerbalSimpit"
REM clean the output folder by removing and recreating it
if exist %OUTPUT_FOLDER% RMDIR /S /Q %OUTPUT_FOLDER%
MKDIR %OUTPUT_FOLDER%
REM Create the version file
(
echo {
echo "NAME": "Kerbal Simpit Revamped",
echo "DOWNLOAD": "https://github.com/Simpit-team/KerbalSimpitRevamped/releases",
echo "GITHUB": {
echo "USERNAME": "Simpit-team",
echo "REPOSITORY": "KerbalSimpitRevamped"
echo },
echo "VERSION": {
echo "MAJOR": %MAJOR%,
echo "MINOR": %MINOR%,
echo "PATCH": %PATCH%,
echo "BUILD": %BUILD%
echo },
echo "KSP_VERSION_MIN": {
echo "MAJOR": %KSPMAJOR%,
echo "MINOR": %KSPMINOR%,
echo "PATCH": %KSPPATCH%
echo },
echo "KSP_VERSION_MAX": {
echo "MAJOR": %KSPMAJOR%,
echo "MINOR": %KSPMINOR%,
echo "PATCH": 99
echo }
echo }
)>"%OUTPUT_FOLDER%\KerbalSimpitRevamped.version"
REM Copy all the files
xcopy /q %ProjectDir%%OutDir%KerbalSimpit.dll %OUTPUT_FOLDER%
xcopy /q %ProjectDir%%OutDir%WindowsInput.dll %OUTPUT_FOLDER%
xcopy /q %ProjectDir%distrib\icon\Simpit_icon_green.png %OUTPUT_FOLDER%
xcopy /q %ProjectDir%distrib\icon\Simpit_icon_orange.png %OUTPUT_FOLDER%
xcopy /q %ProjectDir%distrib\icon\Simpit_icon_red.png %OUTPUT_FOLDER%
xcopy /q %ProjectDir%distrib\Localisation\en-us.cfg %OUTPUT_FOLDER%
xcopy /q %ProjectDir%distrib\Localisation\fr-fr.cfg %OUTPUT_FOLDER%
xcopy /q %ProjectDir%distrib\Localisation\de-de.cfg %OUTPUT_FOLDER%
xcopy /q %ProjectDir%distrib\PluginData\Settings.cfg.sample %OUTPUT_FOLDER%
REM now include the Arduino lib.
set ARDUINOLIB_FOLDER=%ProjectDir%..\KerbalSimpitRevamped-Arduino\
echo %ARDUINOLIB_FOLDER%
if not exist %ARDUINOLIB_FOLDER% (
echo Cannot locate the Arduino libs. Cannot create a release.
exit /b 2
)
xcopy /q /S %ARDUINOLIB_FOLDER%src %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino\src\
xcopy /q /S %ARDUINOLIB_FOLDER%examples %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino\examples\
xcopy /q %ARDUINOLIB_FOLDER%keywords.txt %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino
xcopy /q %ARDUINOLIB_FOLDER%library.properties %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino
xcopy /q %ARDUINOLIB_FOLDER%CHANGELOG.rst %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino
xcopy /q %ARDUINOLIB_FOLDER%DEVNOTES.md %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino
xcopy /q %ARDUINOLIB_FOLDER%LICENSE.md %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino
xcopy /q %ARDUINOLIB_FOLDER%README.rst %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino
xcopy /q %ARDUINOLIB_FOLDER%ressource_list.txt %OUTPUT_FOLDER%\KerbalSimpitRevamped-Arduino
REM now compress it
tar -C %ProjectDir%NextReleases\KerbalSimpitRevamped-v%MAJOR%.%MINOR%.%PATCH% -acf %ProjectDir%NextReleases\KerbalSimpitRevamped-v%MAJOR%.%MINOR%.%PATCH%.zip KerbalSimpit