forked from SRombauts/UE4PlasticPluginDev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildAndPackageForRelease.bat
More file actions
121 lines (96 loc) · 3.18 KB
/
BuildAndPackageForRelease.bat
File metadata and controls
121 lines (96 loc) · 3.18 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
112
113
114
115
116
117
118
119
120
121
@echo off
setlocal
set ROOT_PATH=%~dp0
pushd %ROOT_PATH%
echo Plugins\UEPlasticPlugin\PlasticSourceControl.uplugin:
type Plugins\UEPlasticPlugin\PlasticSourceControl.uplugin
echo.
REM Read the plugin version from uplugin file and prompt the user to check, and name zip files from the version
if [%1] == [] (
set /p VERSION="Enter the version name exactly as in the UE4PlasticPlugin.uplugin above: "
) else (
set VERSION=%1
)
if [%VERSION%] == [] (
echo Version is empty
exit /b 1
)
REM TODO: double check with the uplugin and also search in the README
REM Let's also check we are on main
echo on
git branch
@echo off
REM Ask the user if they agree to do a git clean & a git reset!
set /p GIT_CLEAN_RESET="Git clean & reset before building. WARNING: All your local changes will be stashed away! (ENTER/N)? "
if [%GIT_CLEAN_RESET%] == [] (
echo on
git stash --message "Automatic stash from BuildAndPackageForRelease %VERSION%"
git clean -fdx
git reset --hard
pushd Plugins\UEPlasticPlugin
git stash --message "Automatic stash from BuildAndPackageForRelease %VERSION%"
git clean -fdx
git reset --hard
popd
@echo off
) else (
echo WARNING: Skipping git clean should only be for testing purpose!
)
REM create a tag on the current branch
set /p GIT_TAG="Git tag version %VERSION% of the plugin on the current branch (ENTER/N)? "
if [%GIT_TAG%] == [] (
echo on
pushd Plugins\UEPlasticPlugin
git tag %VERSION%
popd
@echo off
)
REM
REM #####################
REM
call :BuildAndPackage 5.0
call :BuildAndPackage 5.1
call :BuildAndPackage 5.2
call :BuildAndPackage 5.3
call :BuildAndPackage 5.4
call :BuildAndPackage 4.27
REM
REM #####################
REM
echo.
echo NOTE: After validation, push the new tag using:
echo git push https://github.com/PlasticSCM/UEPlasticPlugin.git %VERSION%
exit /b %ERRORLEVEL%
REM
REM ################# BuildAndPackage Function
REM
:BuildAndPackage
set UNREAL_ENGINE=%~1
REM Let's ensure that the plugin correctly builds
del /Q Plugins\UEPlasticPlugin\Binaries\Win64\*
call Build.bat %UNREAL_ENGINE%
if "%UNREAL_ENGINE%" == "4.27" (
if NOT exist Plugins\UEPlasticPlugin\Binaries\Win64\UE4Editor-PlasticSourceControl.dll (
echo Something is wrong, UE4Editor-PlasticSourceControl.dll binaries are missing.
exit /b 1
)
) else (
if NOT exist Plugins\UEPlasticPlugin\Binaries\Win64\UnrealEditor-PlasticSourceControl.dll (
echo Something is wrong, UnrealEditor-PlasticSourceControl.dll binaries are missing.
exit /b 1
)
)
set ARCHIVE_NAME_REL=UE%UNREAL_ENGINE%_PlasticPlugin-%VERSION%.zip
set ARCHIVE_NAME_DBG=UE%UNREAL_ENGINE%_PlasticPlugin-%VERSION%-with-debug-symbols.zip
echo on
del %ARCHIVE_NAME_REL%
del %ARCHIVE_NAME_DBG%
Tools\7-Zip\x64\7za.exe a -tzip %ARCHIVE_NAME_REL% Plugins -xr!".git*" -xr!Intermediate -xr!.editorconfig -xr!_config.yml -xr!Screenshots -xr!"*.pdb"
Tools\7-Zip\x64\7za.exe a -tzip %ARCHIVE_NAME_DBG% Plugins -xr!".git*" -xr!Intermediate -xr!.editorconfig -xr!_config.yml -xr!Screenshots
@echo off
echo Done for Unreal Engine %UNREAL_ENGINE%
echo.
exit /b %ERRORLEVEL%
REM
REM #################
REM