0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 05:30:43 -05:00
modules/project/build.ps1
MadByte 701f676085 Decapitalize BepInEx sub-directories (!100)
This reverts changes to the directory paths made in commit: c7bc0b05143c7062a0c70150cb872b5070f4859c

fixes [SPT-AKI/Issues#588](SPT-AKI/Issues#588)

Co-authored-by: MadByte <madbyte@tuta.io>
Reviewed-on: SPT-AKI/Modules#100
Co-authored-by: MadByte <madbyte@noreply.dev.sp-tarkov.com>
Co-committed-by: MadByte <madbyte@noreply.dev.sp-tarkov.com>
2024-03-24 09:09:43 +00:00

32 lines
1.7 KiB
PowerShell

$buildFolder = "..\Build"
$bepinexFolder = "..\Build\BepInEx"
$bepinexPatchFolder = "..\Build\BepInEx\patchers"
$bepinexPluginFolder = "..\Build\BepInEx\plugins"
$bepinexSptFolder = "..\Build\BepInEx\plugins\spt"
$eftDataFolder = "..\Build\EscapeFromTarkov_Data"
$managedFolder = "..\Build\EscapeFromTarkov_Data\Managed"
$projReleaseFolder = ".\bin\Release\net471"
$licenseFile = "..\..\LICENSE.md"
# Delete build folder and contents to make sure it's clean
if (Test-Path "$buildFolder") { Remove-Item -Path "$buildFolder" -Recurse -Force }
# Create build folder and subfolders if they don't exist
$foldersToCreate = @("$buildFolder", "$bepinexFolder", "$bepinexPatchFolder", "$bepinexPluginFolder", "$bepinexSptFolder", "$eftDataFolder", "$managedFolder")
foreach ($folder in $foldersToCreate) {
if (-not (Test-Path "$folder")) { New-Item -Path "$folder" -ItemType Directory }
}
# Move DLLs from project's bin-release folder to the build folder
Copy-Item "$projReleaseFolder\Aki.Common.dll" -Destination "$managedFolder"
Copy-Item "$projReleaseFolder\Aki.Reflection.dll" -Destination "$managedFolder"
Copy-Item "$projReleaseFolder\aki_PrePatch.dll" -Destination "$bepinexPatchFolder"
Copy-Item "$projReleaseFolder\aki-core.dll" -Destination "$bepinexSptFolder"
Copy-Item "$projReleaseFolder\aki-custom.dll" -Destination "$bepinexSptFolder"
Copy-Item "$projReleaseFolder\aki-debugging.dll" -Destination "$bepinexSptFolder"
Copy-Item "$projReleaseFolder\aki-singleplayer.dll" -Destination "$bepinexSptFolder"
# If any new DLLs need to be copied, add here
# Write the contents of the license file to a txt
Get-Content "$licenseFile" | Out-File "$buildFolder\LICENSE-Modules.txt" -Encoding UTF8