Skip to content

Commit e00aed2

Browse files
authored
Merge pull request #243 from SubnauticaModding/build-compliant-zip
Use 7z for build automation
2 parents 0f66ba6 + f8a3d82 commit e00aed2

File tree

4 files changed

+43
-25
lines changed

4 files changed

+43
-25
lines changed

QModManager.sln

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QModManager.QModPluginGener
3636
EndProject
3737
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QModManager.OculusNewtonsoftRedirect", "OculusNewtonsoftRedirect\QModManager.OculusNewtonsoftRedirect.csproj", "{25558450-FF33-4FDF-91C7-0C5C00A94A57}"
3838
EndProject
39+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Scripts", "Build Scripts", "{075884D3-CC6F-4B56-B050-C31A8E11FA52}"
40+
ProjectSection(SolutionItems) = preProject
41+
Scripts\QModPluginGenerator-post-build.cmd = Scripts\QModPluginGenerator-post-build.cmd
42+
EndProjectSection
43+
EndProject
3944
Global
4045
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4146
BZ.EXP|Any CPU = BZ.EXP|Any CPU
@@ -224,6 +229,9 @@ Global
224229
GlobalSection(SolutionProperties) = preSolution
225230
HideSolutionNode = FALSE
226231
EndGlobalSection
232+
GlobalSection(NestedProjects) = preSolution
233+
{075884D3-CC6F-4B56-B050-C31A8E11FA52} = {5A8D179E-C749-4346-AD81-05F11C082A1C}
234+
EndGlobalSection
227235
GlobalSection(ExtensibilityGlobals) = postSolution
228236
SolutionGuid = {54A73C4F-4981-48CC-AD91-27D3D090D5D4}
229237
EndGlobalSection

QModPluginEmulator/QModManager.QModPluginGenerator.csproj

+4-25
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,11 @@
8585
<Name>QModManager</Name>
8686
</ProjectReference>
8787
</ItemGroup>
88+
<ItemGroup>
89+
<None Include="packages.config" />
90+
</ItemGroup>
8891
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
8992
<PropertyGroup>
90-
<PostBuildEvent>rmdir "$(SolutionDir)VortexBuild\$(Configuration)" /q /s
91-
xcopy "$(SolutionDir)Dependencies\BepInEx" "$(SolutionDir)VortexBuild\$(Configuration)" /E /H /I /Q /Y
92-
xcopy "$(SolutionDir)Dependencies\$(Configuration)\BepInEx.cfg" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\config\" /I /Q /Y
93-
mkdir "$(SolutionDir)VortexBuild\$(Configuration)\QMods"
94-
xcopy "$(SolutionDir)Dependencies\cldb.dat" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
95-
xcopy "$(SolutionDir)packages\AssetsTools.NET.2.0.9\lib\net40\AssetsTools.NET.dll" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
96-
xcopy "$(TargetDir)QModManager.exe" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
97-
xcopy "$(TargetDir)QModManager.QModPluginGenerator.dll" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
98-
xcopy "$(TargetDir)QModManager.UnityAudioFixer.dll" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
99-
xcopy "$(TargetDir)QModManager.UnityAudioFixer.xml" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
100-
101-
if NOT "$(ConfigurationName)" =="SN.STABLE" (
102-
103-
xcopy "$(SolutionDir)Dependencies\Oculus.Newtonsoft.Json.dll" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
104-
xcopy "$(TargetDir)QModManager.OculusNewtonsoftRedirect.dll" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\patchers\QModManager\" /I /Q /Y
105-
)
106-
107-
xcopy "$(TargetDir)QModInstaller.dll" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\plugins\QModManager\" /I /Q /Y
108-
xcopy "$(TargetDir)QModInstaller.xml" "$(SolutionDir)VortexBuild\$(Configuration)\BepInEx\plugins\QModManager\" /I /Q /Y
109-
110-
powershell Compress-Archive -Path '$(SolutionDir)VortexBuild\$(Configuration)\BepInEx' -DestinationPath '$(SolutionDir)VortexBuild\QModManager_$(Configuration).zip' -Force
111-
powershell Compress-Archive -LiteralPath '$(SolutionDir)VortexBuild\$(Configuration)\doorstop_config.ini', '$(SolutionDir)VortexBuild\$(Configuration)\winhttp.dll' -DestinationPath '$(SolutionDir)VortexBuild\QModManager_$(Configuration).zip' -Update
112-
113-
echo F|xcopy /S /Q /Y /F "$(SolutionDir)Installer\$(Configuration).iss" "$(TargetDir)\QModsInstallerScript.iss"
114-
"$(SolutionDir)Dependencies\Inno\ISCC.exe" "$(TargetDir)QModsInstallerScript.iss"</PostBuildEvent>
93+
<PostBuildEvent>call "$(SolutionDir)\Scripts\QModPluginGenerator-post-build.cmd" "$(SolutionDir)" "$(TargetDir)" "$(ConfigurationName)"</PostBuildEvent>
11594
</PropertyGroup>
11695
</Project>

QModPluginEmulator/packages.config

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="7-Zip.CommandLine" version="18.1.0" targetFramework="net472" />
4+
</packages>
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
set solutionDir=%~f1
2+
set targetDir=%~f2
3+
set configName=%3
4+
5+
rmdir "%solutionDir%VortexBuild\%configName%" /q /s
6+
xcopy "%solutionDir%Dependencies\BepInEx" "%solutionDir%VortexBuild\%configName%" /E /H /I /Q /Y
7+
xcopy "%solutionDir%Dependencies\%configName%\BepInEx.cfg" "%solutionDir%VortexBuild\%configName%\BepInEx\config\" /I /Q /Y
8+
mkdir "%solutionDir%VortexBuild\%configName%\QMods"
9+
xcopy "%solutionDir%Dependencies\cldb.dat" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
10+
xcopy "%solutionDir%packages\AssetsTools.NET.2.0.9\lib\net40\AssetsTools.NET.dll" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
11+
xcopy "%targetDir%QModManager.exe" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
12+
xcopy "%targetDir%QModManager.QModPluginGenerator.dll" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
13+
xcopy "%targetDir%QModManager.UnityAudioFixer.dll" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
14+
xcopy "%targetDir%QModManager.UnityAudioFixer.xml" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
15+
16+
if NOT "%configName%" =="SN.STABLE" (
17+
xcopy "%solutionDir%Dependencies\Oculus.Newtonsoft.Json.dll" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
18+
xcopy "%targetDir%QModManager.OculusNewtonsoftRedirect.dll" "%solutionDir%VortexBuild\%configName%\BepInEx\patchers\QModManager\" /I /Q /Y
19+
)
20+
21+
xcopy "%targetDir%QModInstaller.dll" "%solutionDir%VortexBuild\%configName%\BepInEx\plugins\QModManager\" /I /Q /Y
22+
xcopy "%targetDir%QModInstaller.xml" "%solutionDir%VortexBuild\%configName%\BepInEx\plugins\QModManager\" /I /Q /Y
23+
24+
%solutionDir%packages\7-Zip.CommandLine.18.1.0\tools\7za.exe a "%solutionDir%VortexBuild\QModManager_%configName%.zip" "%solutionDir%VortexBuild\%configName%\*"
25+
26+
echo F|xcopy /S /Q /Y /F "%solutionDir%Installer\%configName%.iss" "%targetDir%\QModsInstallerScript.iss"
27+
"%solutionDir%Dependencies\Inno\ISCC.exe" "%targetDir%QModsInstallerScript.iss"

0 commit comments

Comments
 (0)