0
0
mirror of https://github.com/sp-tarkov/build.git synced 2025-02-13 09:50:45 -05:00
build/project/combine_builds.ps1
Refringe 816f791eeb
Changes:
- Removes git directory from container
- Changes all projects to build within a `build` directory
- Adds a combine_builds script that takes the individual project builds and merges them into an `output` directory
- Adds placeholder tag_validate script
- Validates MODULE_DOMAIN env variable
- Updates the Launcher project build to use the `dotnet build` command
- Pins the `dotnet build` command to one thread to prevent Avalonia file access errors on build:
  https://github.com/AvaloniaUI/Avalonia/pull/13840
- Bleeding edge builds are now built as such.

TODO:
- Add additional static project files
- Compress output directory
- Upload release to public folder
- Adapt to work within Drone env
- Adapt build script to work with a dynamic tag value
- Only run project builds when the tag exists in all three projects
2024-02-26 11:15:58 -05:00

58 lines
1.7 KiB
PowerShell

## Take the built project files and combines them into a release folder.
Write-Output " » Combining Project Build Files"
# Set directories
$DIR_ABS = (Get-Location).Path
$DIR_OUTPUT = "$DIR_ABS\release\"
$ProjectPaths = @(
"$DIR_ABS\builds\Server\project\build\",
"$DIR_ABS\builds\Modules\project\build\",
"$DIR_ABS\builds\Launcher\project\Build\"
)
# Remove the release directory if it already exists
if (Test-Path -Path $DIR_OUTPUT) {
Write-Output " » Removing Previous release Directory"
Remove-Item -Recurse -Force $DIR_OUTPUT
}
# Create new directory
New-Item -Path $DIR_OUTPUT -ItemType Directory -Force
# Function to copy project build files
function Copy-ProjectFiles {
param (
[string]$sourceDir
)
Get-ChildItem -Path $sourceDir -Recurse | ForEach-Object {
$relativePath = $_.FullName.Substring($sourceDir.Length)
$targetPath = Join-Path -Path $DIR_OUTPUT -ChildPath $relativePath
if (-not $_.PSIsContainer) {
$targetDir = Split-Path -Path $targetPath -Parent
if (-not (Test-Path -Path $targetDir)) {
New-Item -Path $targetDir -ItemType Directory -Force | Out-Null
}
if ($_.FullName -ne $targetPath) {
Copy-Item -Path $_.FullName -Destination $targetPath -Force
}
}
}
}
try {
foreach ($path in $ProjectPaths) {
Copy-ProjectFiles -sourceDir $path
}
} catch {
Write-Error "An error occurred: $_"
}
# Missing
#BepInEx\core\
#BepInEx\config\
#doorstop_config.ini
#winhttp.dll
#LICENCE-BEPINEX.txt
#LICENCE-ConfigurationManager.txt