-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildAndPackageForMarketplace.bat
More file actions
156 lines (114 loc) · 5.04 KB
/
BuildAndPackageForMarketplace.bat
File metadata and controls
156 lines (114 loc) · 5.04 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
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
@echo off
setlocal
set ROOT_PATH=%~dp0
pushd %ROOT_PATH%
echo Plugins\UnityVersionControl\UnityVersionControl.uplugin:
type Plugins\UnityVersionControl\UnityVersionControl.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 UnityVersionControl.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! Else we abort the process.
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\UnityVersionControl
git stash --message "Automatic stash from BuildAndPackageForRelease %VERSION%"
git clean -fdx
git reset --hard
popd
@echo off
) else (
echo Git clean is required, exiting.
exit /b
)
echo Check that Plugins\UEPlasticPlugin\Source\UnityVersionControl\UnityVersionControl.Build.cs had "bEnforceIWYU = true;" enabled and clean the file for release.
set /p PAUSE="WARNING: Make sure that Source\UE5PlasticPluginDevEditor.Target.cs has "bUseUnityBuild" set to true, commented or removed (ENTER)"
REM
REM #####################
REM
call :BuildAndPackage 5.0
REM NOTE: Unreal 5.1 would like IncludeOrderVersion = EngineIncludeOrderVersion.Latest; we have to edit "UE5PlasticPluginDevEditor.Target.csmanually before continuing!
set /p PAUSE="WARNING: you have to edit Source\UE5PlasticPluginDevEditor.Target.cs and uncomment "IncludeOrderVersion = EngineIncludeOrderVersion.Latest;" before compiling for UE5.1 (ENTER)"
call :BuildAndPackage 5.1
REM NOTE: Unreal 5.2 deprecated bEnforceIWYU, we have to edit "UnityVersionControl.Build.cs" manually before continuing!
set /p PAUSE="WARNING: you have to edit Plugins\UEPlasticPlugin\Source\UnityVersionControl\UnityVersionControl.Build.cs and uncomment "IWYUSupport = IWYUSupport.Full;" instead of "bEnforceIWYU = true;" before compiling for UE5.2 (ENTER)"
call :BuildAndPackage 5.2
call :BuildAndPackage 5.3
REM NOTE: Unreal 5.4 requires strict conformance mode, we have to edit "UE5PlasticPluginDevEditor.Target.cs" manually before continuing!
set /p PAUSE="WARNING: you have to edit Source\UE5PlasticPluginDevEditor.Target.cs and uncomment WindowsPlatform.bStrictConformanceMode = true; before compiling for UE5.4 (ENTER)"
call :BuildAndPackage 5.4
REM NOTE: Unreal 5.5 requires C++20 if not compiling with Unity Builds, we have to edit "UE5PlasticPluginDevEditor.Target.cs" manually before continuing!
set /p PAUSE="WARNING: you have to edit Source\UE5PlasticPluginDevEditor.Target.cs and uncomment CppStandard = CppStandardVersion.Cpp20; before compiling for UE5.5 (ENTER)"
call :BuildAndPackage 5.5
call :BuildAndPackage 5.6
call :BuildAndPackage 5.7
REM
REM #####################
REM
echo .
echo NOTE: After validation, post the source package to Github and link them to the Fab.com Marketplace dashboard
exit /b %ERRORLEVEL%
REM
REM ################# BuildAndPackage Function
REM
:BuildAndPackage
set UNREAL_ENGINE=%~1
call :ReplaceEngineVersion 5.0.0 %UNREAL_ENGINE%.0
REM Let's ensure that the plugin correctly builds
del /Q Plugins\UnityVersionControl\Binaries\Win64\*
call Build.bat %UNREAL_ENGINE%
if NOT exist Plugins\UnityVersionControl\Binaries\Win64\UnrealEditor-UnityVersionControl.dll (
echo Something is wrong, some binaries are missing.
exit /b 1
)
REM Create the archive for the Marketplace from within the Plugins subfolder for a cleaner ZIP
cd Plugins
set ARCHIVE_NAME_REL=UE%UNREAL_ENGINE%_UnityVersionControl-%VERSION%.zip
echo on
del ..\%ARCHIVE_NAME_REL%
..\Tools\7-Zip\x64\7za.exe a -tzip ..\%ARCHIVE_NAME_REL% UnityVersionControl -xr!Binaries -xr!Intermediate -xr!Screenshots -xr!.editorconfig -xr!".git*" -xr!"cm.log.conf" -xr!_config.yml -xr!README.md -xr!"*.pdb"
@echo off
cd ..
call :ReplaceEngineVersion %UNREAL_ENGINE%.0 5.0.0
echo Done for Unreal Engine %UNREAL_ENGINE%
echo .
exit /b %ERRORLEVEL%
REM
REM ################# ReplaceEngineVersion Function
REM
:ReplaceEngineVersion
set OLD_VERSION=%~1
set NEW_VERSION=%~2
set UPLUGIN=Plugins\UnityVersionControl\UnityVersionControl.uplugin
if [%OLD_VERSION%] == [%NEW_VERSION%] (
exit /b
)
echo Replace "EngineVersion": "%OLD_VERSION%" by "%NEW_VERSION%" in %UPLUGIN%
setlocal enableextensions disabledelayedexpansion
for /f "delims=" %%i in ('type "%UPLUGIN%" ^& break ^> "%UPLUGIN%" ') do (
set "line=%%i"
setlocal enabledelayedexpansion
>>"%UPLUGIN%" echo(!line:%OLD_VERSION%=%NEW_VERSION%!
endlocal
)
endlocal
exit /b %ERRORLEVEL%
REM
REM #################
REM