/
publishEngine.bat
168 lines (130 loc) · 6.54 KB
/
publishEngine.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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
::@ECHO OFF
:: ######################
:: # Init stuff and vars
:: ######################
::TODO: Ask for version number and inject to .zip files
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
set host=%COMPUTERNAME%
set starttime=%TIME%
set startcsec=%STARTTIME:~9,2%
set startsecs=%STARTTIME:~6,2%
set startmins=%STARTTIME:~3,2%
set starthour=%STARTTIME:~0,2%
set /a starttime=(%starthour%*60*60*100)+(%startmins%*60*100)+(%startsecs%*100)+(%startcsec%)
:: #####################
:: # Cleanup old build
:: #####################
rmdir /Q /S "./propellerengine_full/"
rmdir /Q /S "./propellerengine_patch/"
mkdir "propellerengine_full/"
mkdir "propellerengine_patch/"
del propellerengine_full.zip
del propellerengine_patch.zip
:: ###########################################
:: # Build the engine with all configurations
:: ###########################################
cd windows
msbuild /t:Clean PropellerEngine.sln /property:Configuration=GameDebug;Platform=Win32
msbuild /t:Clean PropellerEngine.sln /property:Configuration=GameDevelopment;Platform=Win32
msbuild /t:Clean PropellerEngine.sln /property:Configuration=GameRelease;Platform=Win32
msbuild /t:Clean PropellerEngine.sln /property:Configuration=GameDebug;Platform=Tegra-Android
msbuild /t:Clean PropellerEngine.sln /property:Configuration=GameRelease;Platform=Tegra-Android
msbuild /t:Rebuild PropellerEngine.sln /property:Configuration=GameRelease;Platform=Tegra-Android
msbuild /t:Rebuild PropellerEngine.sln /property:Configuration=GameDebug;Platform=Tegra-Android
msbuild /t:Rebuild PropellerEngine.sln /property:Configuration=GameDebug;Platform=Win32
msbuild /t:Rebuild PropellerEngine.sln /property:Configuration=GameDevelopment;Platform=Win32
msbuild /t:Rebuild PropellerEngine.sln /property:Configuration=GameRelease;Platform=Win32
msbuild /t:Rebuild PropellerEngine.sln /property:Configuration=GameDebugGL2;Platform=Win32
:: Move back to the project root from build directory
cd ..
:: #############################################
:: # Build the shaders and crosscompile to glsl
:: #############################################
call "./compileShaders.bat"
:: ###############################################################
:: # Copy relevant files into the propellerengine_full directory
:: ###############################################################
:: Copy all relevant files
xcopy /E /Y ".\bin" ".\propellerengine_full\bin\"
xcopy /E /Y ".\data" ".\propellerengine_full\data\"
xcopy /E /Y ".\enginedata" ".\propellerengine_full\enginedata\"
xcopy /E /Y ".\other" ".\propellerengine_full\other\"
xcopy /E /Y ".\src" ".\propellerengine_full\src\"
xcopy /E /Y ".\thirdparty" ".\propellerengine_full\thirdparty\"
xcopy /E /Y ".\src" ".\propellerengine_full\src\"
xcopy /E /Y ".\windows\*.props" ".\propellerengine_full\windows\"
xcopy /E /Y ".\windows\PropellerGame.sln" ".\propellerengine_full\windows\"
xcopy /E /Y ".\windows\Shaders" ".\propellerengine_full\windows\Shaders\"
xcopy /E /Y ".\windows\EngineReference" ".\propellerengine_full\windows\EngineReference\"
xcopy /E /Y ".\windows\Game" ".\propellerengine_full\windows\Game\"
xcopy /E /Y ".\windows\Standalone" ".\propellerengine_full\windows\Standalone\"
xcopy /E /Y ".\windows\build\GameDebug\*.lib" ".\propellerengine_full\windows\build\GameDebug\*.lib"
xcopy /E /Y ".\windows\build\GameDevelopment\*.lib" ".\propellerengine_full\windows\build\GameDevelopment\*.lib"
xcopy /E /Y ".\windows\build\GameRelease\*.lib" ".\propellerengine_full\windows\build\GameRelease\*.lib"
xcopy /E /Y ".\windows\build\GameDebug\*.a" ".\propellerengine_full\windows\build\GameDebugGL2\*.a"
xcopy /E /Y ".\windows\build\GameDebug\*.a" ".\propellerengine_full\windows\build\GameDebug\*.a"
xcopy /E /Y ".\windows\build\GameDebug\*.a" ".\propellerengine_full\windows\build\GameDebugGL2\*.a"
xcopy /E /Y ".\windows\build\GameDevelopment\*.a" ".\propellerengine_full\windows\build\GameDevelopment\*.a"
xcopy /E /Y ".\windows\build\GameRelease\*.a" ".\propellerengine_full\windows\build\GameRelease\*.a"
copy "LICENSE.txt" ".\propellerengine_full\"
copy "README.md" ".\propellerengine_full\"
copy ".gitignore" ".\propellerengine_full\"
:: TODO consider dropping gitignore for patch
rmdir /Q /S propellerengine_full/src/html/
rmdir /Q /S propellerengine_full/src/unittesting/
rmdir /Q /S propellerengine_full/src/editorbackend/
rmdir /Q /S propellerengine_full/thirdparty/orbit_toolkit/
del /S .\propellerengine_full\*.cpp
del /S .\propellerengine_full\*.c
:: Copy these after the .c/.cpp delete, these source files are for the user
xcopy /E /Y ".\src\game" ".\propellerengine_full\src\game"
xcopy /E /Y ".\src\standalone" ".\propellerengine_full\src\standalone"
xcopy /E /Y ".\doc" ".\propellerengine_full\doc\"
:: Copy androidnative and cleanup
xcopy /E /Y ".\android" ".\propellerengine_full\android\"
rmdir /Q /S propellerengine_full/android/NativePropeller/Tegra-Android/
:: ##################################
:: # Inject timestamp to the release
:: ##################################
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a
set datestamp=%dt:~0,8%
set timestamp=%dt:~8,6%
set YYYY=%dt:~0,4%
set MM=%dt:~4,2%
set DD=%dt:~6,2%
set HH=%dt:~8,2%
set Min=%dt:~10,2%
set Sec=%dt:~12,2%
set stamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%
echo PropellerEngine build on %host% at %stamp% > .\propellerengine_full\timestamp.txt
:: ############################################
:: # Build patch zip. (remove user data files)
:: # First make a copy of the full folder
:: ############################################
xcopy /E /Y ".\propellerengine_full" ".\propellerengine_patch"
rmdir /Q /S "propellerengine_patch/data/"
rmdir /Q /S "propellerengine_patch/bin/"
rmdir /Q /S "propellerengine_patch/src/game/"
rmdir /Q /S "propellerengine_patch/windows/Game/"
:: ####################
:: # ZIP THE FILES
:: # (Only if 7-zip exists)
:: ####################
"%PROGRAMFILES%\7-Zip\7z.exe" a -tzip propellerengine_full.zip .\propellerengine_full\ -r
"%PROGRAMFILES%\7-Zip\7z.exe" a -tzip propellerengine_patch.zip .\propellerengine_patch\ -r
set endtime=%time%
echo ################################
echo # PropellerEngine release done #
echo ################################
set endtime=%time%
set endcsec=%endTIME:~9,2%
set endsecs=%endTIME:~6,2%
set endmins=%endTIME:~3,2%
set endhour=%endTIME:~0,2%
if %endhour% LSS %starthour% set /a endhour+=24
set /a endtime=(%endhour%*60*60*100)+(%endmins%*60*100)+(%endsecs%*100)+(%endcsec%)
set /a timetaken= ( %endtime% - %starttime% )
set /a timetakens= %timetaken% / 100
set timetaken=%timetakens%.%timetaken:~-2%
echo Build took: %timetaken% sec.
pause