forked from SaiyansKing/GD3D11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssemblePackage.ps1
51 lines (45 loc) · 2.17 KB
/
AssemblePackage.ps1
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
# Define paths
$solutionPath = "Direct3D7Wrapper.sln"
$outputFolder = "Z:/HumiliationRitual/"
$binFolder = "$outputFolder/GD3D11/Bin/"
$msBuildPath = "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\amd64\MSBuild.exe"
$current_date = Get-Date -Format "dd-MM-yyyy"
$configurations = @{
"Release_G1_SSE2" = "g1.dll"
"Release_G1_AVX" = "g1_avx.dll"
"Release_G1_AVX2" = "g1_avx2.dll"
"Release_G1A_SSE2" = "g1a.dll"
"Release_G1A_AVX" = "g1a_avx.dll"
"Release_G1A_AVX2" = "g1a_avx2.dll"
"Release_G2A_SSE2" = "g2a.dll"
"Release_G2A_AVX" = "g2a_avx.dll"
"Release_G2A_AVX2" = "g2a_avx2.dll"
"SpacerNET_G1_SSE2" = "spacernet_g1.dll"
"SpacerNET_G1_AVX" = "spacernet_g1_avx.dll"
"SpacerNET_G1_AVX2" = "spacernet_g1_avx2.dll"
"SpacerNET_G2A_SSE2" = "spacernet_g2a.dll"
"SpacerNET_G2A_AVX" = "spacernet_g2a_avx.dll"
"SpacerNET_G2A_AVX2" = "spacernet_g2a_avx2.dll"
}
if (-Not (Test-Path -Path $binFolder)) {
New-Item -ItemType Directory -Path $binFolder
}
robocopy "$PSScriptRoot\blobs\Meshes\" "$outputFolder\GD3D11\Meshes\" /E /MT
robocopy "$PSScriptRoot\blobs\Textures\" "$outputFolder\GD3D11\Textures\" /E /MT
robocopy "$PSScriptRoot\blobs\Fonts\" "$outputFolder\GD3D11\Fonts\" /E /MT
robocopy "$PSScriptRoot\blobs\libs\" "$outputFolder\" /E /MT
robocopy "$PSScriptRoot\D3D11Engine\Shaders\" "$outputFolder\GD3D11\Shaders\" /E /MT
robocopy "$PSScriptRoot\D3D11Engine\CSFFT\" "$outputFolder\GD3D11\Shaders\CSFFT" *.hlsl /E /MT
# Compile main ddraw.dll component
& $msBuildPath $solutionPath /p:Configuration="Launcher"
$outputFile = "$PSScriptRoot\Launcher\ddraw.dll"
Copy-Item -Path $outputFile -Destination $outputFolder -Recurse -Force
# Compile all the bullshit dlls
foreach ($config in $configurations.Keys) {
& $msBuildPath $solutionPath /p:Configuration=$config
$outputFile = "$PSScriptRoot\$config\$($configurations[$config])"
Copy-Item -Path $outputFile -Destination $binFolder -Recurse -Force
}
# pack this bitch and go
& "C:\Program Files\7-Zip\7z.exe" -mx=9 -t7z a "GD3D11-$current_date.7z" "$outputFolder\*"
#& "C:\Program Files\7-Zip-Zstandard\7z.exe" -mx=9 -t7z a "GD3D11-$current_date.7z" "$outputFolder\*"