2020-10-05 17:36:31 +01:00
|
|
|
# Packaging helper
|
|
|
|
# Bumps versions, builds, cooks, packages variants
|
|
|
|
# Put packageconfig.json in your project folder to configure
|
|
|
|
# See packageconfig_template.json
|
2020-10-02 18:27:56 +01:00
|
|
|
[CmdletBinding()] # Fail on unknown args
|
|
|
|
param (
|
|
|
|
[string]$src,
|
2023-09-18 17:08:25 +01:00
|
|
|
[string]$out,
|
2020-10-02 18:27:56 +01:00
|
|
|
[switch]$major = $false,
|
|
|
|
[switch]$minor = $false,
|
|
|
|
[switch]$patch = $false,
|
|
|
|
[switch]$hotfix = $false,
|
2023-09-18 17:08:25 +01:00
|
|
|
[switch]$nightly = $false,
|
|
|
|
# Don't increment version
|
2020-10-05 17:04:35 +01:00
|
|
|
[switch]$keepversion = $false,
|
2020-10-02 18:27:56 +01:00
|
|
|
# Name of variant to build (optional, uses DefaultVariants from packageconfig.json if unspecified)
|
2020-10-06 12:08:41 +01:00
|
|
|
[array]$variants,
|
2020-10-02 18:27:56 +01:00
|
|
|
# Testing mode; skips clean checks, tags
|
|
|
|
[switch]$test = $false,
|
2020-10-14 16:45:03 +01:00
|
|
|
# Browse the output directory in file explorer after packaging
|
|
|
|
[switch]$browse = $false,
|
2020-10-02 18:27:56 +01:00
|
|
|
# Dry-run; does nothing but report what *would* have happened
|
|
|
|
[switch]$dryrun = $false,
|
|
|
|
[switch]$help = $false
|
|
|
|
)
|
|
|
|
|
2020-10-05 17:42:13 +01:00
|
|
|
. $PSScriptRoot\inc\platform.ps1
|
2020-10-02 18:27:56 +01:00
|
|
|
. $PSScriptRoot\inc\packageconfig.ps1
|
|
|
|
. $PSScriptRoot\inc\projectversion.ps1
|
2020-10-05 13:14:23 +01:00
|
|
|
. $PSScriptRoot\inc\uproject.ps1
|
2020-10-05 16:18:30 +01:00
|
|
|
. $PSScriptRoot\inc\ueeditor.ps1
|
2020-10-06 15:22:33 +01:00
|
|
|
. $PSScriptRoot\inc\filetools.ps1
|
2020-10-02 18:27:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
function Write-Usage {
|
2022-04-19 12:07:09 +01:00
|
|
|
Write-Output "Steve's Unreal packaging tool"
|
2020-10-02 18:27:56 +01:00
|
|
|
Write-Output "Usage:"
|
2023-09-18 17:08:25 +01:00
|
|
|
Write-Output " ue-package.ps1 [-src:sourcefolder] [-out:folder] [-major|-minor|-patch|-hotfix] [-keepversion] [-force] [-variant=VariantName] [-test] [-dryrun]"
|
2020-10-02 18:27:56 +01:00
|
|
|
Write-Output " "
|
2020-10-12 14:20:07 +01:00
|
|
|
Write-Output " -src : Source folder (current folder if omitted), must contain packageconfig.json"
|
2023-09-18 17:08:25 +01:00
|
|
|
Write-OUtput " -out : Overrides OutputDir in packageconfig.json"
|
2020-10-02 18:27:56 +01:00
|
|
|
Write-Output " -major : Increment major version i.e. [x++].0.0.0"
|
|
|
|
Write-Output " -minor : Increment minor version i.e. x.[x++].0.0"
|
|
|
|
Write-Output " -patch : Increment patch version i.e. x.x.[x++].0 (default)"
|
|
|
|
Write-Output " -hotfix : Increment hotfix version i.e. x.x.x.[x++]"
|
|
|
|
Write-Output " -keepversion : Keep current version number, doesn't tag unless -forcetag"
|
2023-09-18 17:08:25 +01:00
|
|
|
Write-Output " -nightly : Nightly build, doesn't tag, doesn't commit, re-uses same nightly folder, appends git rev version"
|
2020-10-06 12:08:41 +01:00
|
|
|
Write-Output " -variants Name1,Name2,Name3"
|
|
|
|
Write-Output " : Build only named variants instead of DefaultVariants from packageconfig.json"
|
2020-10-02 18:27:56 +01:00
|
|
|
Write-Output " -test : Testing mode, separate builds, allow dirty working copy"
|
2020-10-14 16:45:03 +01:00
|
|
|
Write-Output " -browse : After packaging, browse the output folder"
|
2020-10-02 18:27:56 +01:00
|
|
|
Write-Output " -dryrun : Don't perform any actual actions, just report on what you would do"
|
|
|
|
Write-Output " -help : Print this help"
|
2020-10-08 15:25:29 +01:00
|
|
|
Write-Output " "
|
|
|
|
Write-Output "Environment Variables:"
|
2022-04-19 12:07:09 +01:00
|
|
|
Write-Output " UEINSTALL : Use a specific Unreal install."
|
|
|
|
Write-Output " : Default is to find one based on project version, under UEROOT"
|
|
|
|
Write-Output " UEROOT : Parent folder of all binary Unreal installs (detects version). "
|
2020-10-08 15:25:29 +01:00
|
|
|
Write-Output " : Default C:\Program Files\Epic Games"
|
|
|
|
Write-Output " "
|
2020-10-02 18:27:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($src.Length -eq 0) {
|
|
|
|
$src = "."
|
|
|
|
Write-Verbose "-src not specified, assuming current directory"
|
|
|
|
}
|
|
|
|
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
|
|
|
if ($help) {
|
|
|
|
Write-Usage
|
|
|
|
Exit 0
|
|
|
|
}
|
|
|
|
|
2022-04-19 12:07:09 +01:00
|
|
|
Write-Output "~-~-~ Unreal Packaging Helper Start ~-~-~"
|
2020-10-05 13:14:23 +01:00
|
|
|
|
2020-10-02 18:27:56 +01:00
|
|
|
if ($test) {
|
|
|
|
Write-Output "TEST MODE: No tagging, version bumping"
|
|
|
|
}
|
|
|
|
|
|
|
|
if (([bool]$major + [bool]$minor + [bool]$patch + [bool]$hotfix) -gt 1) {
|
|
|
|
Write-Output "ERROR: Can't set more than one of major/minor/patch/hotfix at the same time!"
|
|
|
|
Print-Usage
|
|
|
|
Exit 5
|
|
|
|
}
|
|
|
|
if (($major -or $minor -or $patch -or $hotfix) -and $keepversion) {
|
|
|
|
Write-Output "ERROR: Can't set keepversion at the same time as major/minor/patch/hotfix!"
|
|
|
|
Print-Usage
|
|
|
|
Exit 5
|
|
|
|
}
|
|
|
|
|
|
|
|
# Detect Git
|
|
|
|
if ($src -ne ".") { Push-Location $src }
|
|
|
|
$isGit = Test-Path ".git"
|
|
|
|
if ($src -ne ".") { Pop-Location }
|
|
|
|
|
|
|
|
# Check working copy is clean (Git only)
|
|
|
|
if (-not $test -and $isGit) {
|
|
|
|
if ($src -ne ".") { Push-Location $src }
|
|
|
|
|
|
|
|
if (Test-Path ".git") {
|
|
|
|
git diff --no-patch --exit-code
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
Write-Output "Working copy is not clean (unstaged changes)"
|
|
|
|
if ($dryrun) {
|
|
|
|
Write-Output "dryrun: Continuing but this will fail without -dryrun"
|
|
|
|
} else {
|
|
|
|
Exit $LASTEXITCODE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
git diff --no-patch --cached --exit-code
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
Write-Output "Working copy is not clean (staged changes)"
|
|
|
|
if ($dryrun) {
|
|
|
|
Write-Output "dryrun: Continuing but this will fail without -dryrun"
|
|
|
|
} else {
|
|
|
|
Exit $LASTEXITCODE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($src -ne ".") { Pop-Location }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
2020-10-05 13:14:23 +01:00
|
|
|
# Import config & project settings
|
|
|
|
$config = Read-Package-Config -srcfolder:$src
|
|
|
|
$projfile = Get-Uproject-Filename -srcfolder:$src -config:$config
|
2020-10-05 13:26:41 +01:00
|
|
|
$proj = Read-Uproject $projfile
|
|
|
|
$ueVersion = Get-UE-Version $proj
|
|
|
|
$ueinstall = Get-UE-Install $ueVersion
|
2020-10-05 13:14:23 +01:00
|
|
|
|
2020-10-06 11:40:51 +01:00
|
|
|
$chosenVariantNames = $config.DefaultVariants
|
2020-10-06 12:08:41 +01:00
|
|
|
if ($variants) {
|
|
|
|
$chosenVariantNames = $variants
|
|
|
|
}
|
2020-10-06 11:40:51 +01:00
|
|
|
# TODO support overriding default variants with args
|
|
|
|
$chosenVariants = $config.Variants | Where-Object { $chosenVariantNames -contains $_.Name }
|
|
|
|
|
|
|
|
if ($chosenVariants.Count -ne $chosenVariantNames.Count) {
|
|
|
|
$unmatchedVariants = $chosenVariantNames | Where-Object { $chosenVariants.Name -notcontains $_ }
|
|
|
|
Write-Warning "Unknown variant(s) ignored: $($unmatchedVariants -join ", ")"
|
|
|
|
}
|
|
|
|
|
2020-10-06 17:14:23 +01:00
|
|
|
$foundmaps = Find-Files -startDir:$(Join-Path $src "Content") -pattern:*.umap -includeByDefault:$config.CookAllMaps -includeBaseNames:$config.MapsIncluded -excludeBaseNames:$config.MapsExcluded
|
|
|
|
|
|
|
|
$maps = $foundmaps.BaseNames
|
2020-10-06 12:48:10 +01:00
|
|
|
|
2020-10-12 14:20:37 +01:00
|
|
|
$mapsdesc = $maps ? $maps -join ", " : "Default (Project Settings)"
|
|
|
|
|
2023-09-18 17:08:25 +01:00
|
|
|
|
2020-10-05 13:14:23 +01:00
|
|
|
Write-Output ""
|
2020-10-06 12:48:10 +01:00
|
|
|
Write-Output "Project File : $projfile"
|
2020-10-06 11:40:51 +01:00
|
|
|
Write-Output "UE Version : $ueVersion"
|
|
|
|
Write-Output "UE Install : $ueinstall"
|
2023-09-18 17:08:25 +01:00
|
|
|
if ($out.Length -eq 0) {
|
|
|
|
Write-Output "Output Folder : $($config.OutputDir)"
|
|
|
|
} else {
|
|
|
|
Write-Output "Output Folder : $out"
|
|
|
|
}
|
2020-10-06 12:48:10 +01:00
|
|
|
Write-Output "Zipped Folder : $($config.ZipDir)"
|
|
|
|
Write-Output ""
|
2020-10-06 11:40:51 +01:00
|
|
|
Write-Output "Chosen Variants : $chosenVariantNames"
|
2020-10-12 14:20:37 +01:00
|
|
|
Write-Output "Maps to Cook : $mapsdesc"
|
2020-10-05 13:14:23 +01:00
|
|
|
Write-Output ""
|
|
|
|
|
2020-10-15 15:35:49 +01:00
|
|
|
if (-not $dryrun)
|
|
|
|
{
|
|
|
|
$editorprojname = [System.IO.Path]::GetFileNameWithoutExtension($projfile)
|
|
|
|
Close-UE-Editor $editorprojname $dryrun
|
|
|
|
}
|
2020-10-05 13:14:23 +01:00
|
|
|
|
2020-10-02 18:27:56 +01:00
|
|
|
if (([bool]$major + [bool]$minor + [bool]$patch + [bool]$hotfix) -eq 0) {
|
|
|
|
$patch = $true
|
|
|
|
}
|
2020-10-05 17:42:13 +01:00
|
|
|
$versionNumber = $null
|
2023-09-18 17:08:25 +01:00
|
|
|
if ($nightly) {
|
|
|
|
$versionNumber = "nightly"
|
|
|
|
|
|
|
|
if ($isGit)
|
|
|
|
{
|
|
|
|
# Add the git ref to the version number in the project ONLY (not our folder)
|
|
|
|
$tempverobj = Get-ProjectVersionComponents $src
|
|
|
|
$gitref = $(git rev-parse --short HEAD)
|
|
|
|
$tempverobj.postfix = "-$gitref"
|
|
|
|
Write-Output "Packaging nightly-$gitref"
|
|
|
|
Write-ProjectVersionFromObject -srcfolder:$src -versionObj:$tempverobj -dryrun:$dryrun
|
|
|
|
}
|
|
|
|
|
|
|
|
} elseif ($keepversion) {
|
2020-10-05 17:42:13 +01:00
|
|
|
$versionNumber = Get-Project-Version $src
|
2020-10-02 18:27:56 +01:00
|
|
|
} else {
|
|
|
|
# Bump up version, passthrough options
|
|
|
|
try {
|
2020-10-05 17:42:13 +01:00
|
|
|
$versionNumber = Increment-Project-Version -srcfolder:$src -major:$major -minor:$minor -patch:$patch -hotfix:$hotfix -dryrun:$dryrun
|
2020-10-02 18:27:56 +01:00
|
|
|
if (-not $dryrun -and $isGit) {
|
|
|
|
if ($src -ne ".") { Push-Location $src }
|
|
|
|
|
2020-10-05 13:14:23 +01:00
|
|
|
$verIniFile = Get-Project-Version-Ini-Filename $src
|
2020-10-02 18:27:56 +01:00
|
|
|
git add "$($verIniFile)"
|
|
|
|
if ($LASTEXITCODE -ne 0) { Exit $LASTEXITCODE }
|
2020-10-05 17:42:13 +01:00
|
|
|
git commit -m "Version bump to $versionNumber"
|
2020-10-02 18:27:56 +01:00
|
|
|
if ($LASTEXITCODE -ne 0) { Exit $LASTEXITCODE }
|
|
|
|
|
|
|
|
if ($src -ne ".") { Pop-Location }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch {
|
|
|
|
Write-Output $_.Exception.Message
|
|
|
|
Exit 6
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# Keep test builds separate
|
|
|
|
if ($test) {
|
2020-10-05 17:42:13 +01:00
|
|
|
$versionNumber = "$versionNumber-test"
|
2020-10-02 18:27:56 +01:00
|
|
|
}
|
2020-10-05 17:42:13 +01:00
|
|
|
Write-Output "Next version will be: $versionNumber"
|
2020-10-02 18:27:56 +01:00
|
|
|
|
|
|
|
# For tagging release
|
|
|
|
# We only need to grab the main version once
|
2023-09-18 17:08:25 +01:00
|
|
|
if (-not $keepversion -and -not $nightly) {
|
2023-07-20 14:46:23 +01:00
|
|
|
|
2021-08-02 15:56:47 +01:00
|
|
|
if (-not $test -and -not $dryrun -and $isGit) {
|
2020-11-17 14:34:22 +00:00
|
|
|
if ($src -ne ".") { Push-Location $src }
|
2023-07-20 14:46:23 +01:00
|
|
|
git tag -a $versionNumber -m "Automated release tag"
|
2020-11-17 14:34:22 +00:00
|
|
|
if ($LASTEXITCODE -ne 0) { Exit $LASTEXITCODE }
|
|
|
|
if ($src -ne ".") { Pop-Location }
|
|
|
|
}
|
2020-10-02 18:27:56 +01:00
|
|
|
}
|
|
|
|
|
2022-04-19 12:07:09 +01:00
|
|
|
|
2023-09-19 16:14:52 +01:00
|
|
|
# We need to build the host Editor target explicitly first, which will be used
|
|
|
|
# to run the "Cook" stage. If we don't do this, then any source plugins will
|
|
|
|
# be missing in a clean checkout build and the cook stage will fail
|
|
|
|
Write-Output "Building Editor (for Cooking)"
|
2023-09-28 14:41:56 +01:00
|
|
|
.\ue-build.ps1 -mode:dev -src:$src -nocloseeditor -dryrun:$dryrun
|
2023-09-19 16:14:52 +01:00
|
|
|
|
2022-04-19 12:07:09 +01:00
|
|
|
$ueEditorCmd = Get-UEEditorCmd $ueVersion $ueinstall
|
2020-10-05 17:42:13 +01:00
|
|
|
$runUAT = Join-Path $ueinstall "Engine/Build/BatchFiles/RunUAT$batchSuffix"
|
|
|
|
|
|
|
|
|
2020-10-06 12:08:41 +01:00
|
|
|
foreach ($var in $chosenVariants) {
|
2020-10-05 17:42:13 +01:00
|
|
|
|
2023-09-18 17:08:25 +01:00
|
|
|
if ($out.Length -gt 0) {
|
|
|
|
$outDir = Join-Path $out "$($var.Name)-$($versionNumber)"
|
|
|
|
} else {
|
|
|
|
$outDir = Get-Package-Dir -config:$config -versionNumber:$versionNumber -variantName:$var.Name
|
|
|
|
}
|
2020-10-05 17:42:13 +01:00
|
|
|
|
2023-09-18 11:20:01 +01:00
|
|
|
# Delete previous
|
2023-09-18 12:22:48 +01:00
|
|
|
Remove-Item -Path $outDir -Recurse -Force -ErrorAction SilentlyContinue
|
2023-09-18 11:20:01 +01:00
|
|
|
|
2020-10-05 17:42:13 +01:00
|
|
|
$argList = [System.Collections.ArrayList]@()
|
2020-10-05 16:21:05 +01:00
|
|
|
$argList.Add("-ScriptsForProject=`"$projfile`"") > $null
|
|
|
|
$argList.Add("BuildCookRun") > $null
|
|
|
|
$argList.Add("-nocompileeditor") > $null
|
|
|
|
#$argList.Add("-installed") > $null # don't think we need this, seems to be detected
|
|
|
|
$argList.Add("-nop4") > $null
|
|
|
|
$argList.Add("-project=`"$projfile`"") > $null
|
|
|
|
$argList.Add("-cook") > $null
|
|
|
|
$argList.Add("-stage") > $null
|
|
|
|
$argList.Add("-archive") > $null
|
|
|
|
$argList.Add("-archivedirectory=`"$($outDir)`"") > $null
|
|
|
|
$argList.Add("-package") > $null
|
2022-04-19 12:07:09 +01:00
|
|
|
if ((Get-Is-UE5 $ueVersion)) {
|
|
|
|
$argList.Add("-unrealexe=`"$ueEditorCmd`"") > $null
|
|
|
|
} else {
|
|
|
|
$argList.Add("-ue4exe=`"$ueEditorCmd`"") > $null
|
|
|
|
}
|
2020-10-06 13:03:51 +01:00
|
|
|
if ($config.UsePak) {
|
|
|
|
$argList.Add("-pak") > $null
|
|
|
|
}
|
2020-10-05 16:21:05 +01:00
|
|
|
$argList.Add("-prereqs") > $null
|
|
|
|
$argList.Add("-build") > $null
|
|
|
|
$argList.Add("-target=$($config.Target)") > $null
|
2020-10-06 12:08:41 +01:00
|
|
|
$argList.Add("-clientconfig=$($var.Configuration)") > $null
|
|
|
|
$argList.Add("-targetplatform=$($var.Platform)") > $null
|
2020-10-05 16:21:05 +01:00
|
|
|
$argList.Add("-utf8output") > $null
|
2020-10-06 12:48:10 +01:00
|
|
|
if ($maps.Count) {
|
|
|
|
$argList.Add("-Map=$($maps -join "+")") > $null
|
|
|
|
}
|
2020-10-07 11:40:59 +01:00
|
|
|
if ($var.Cultures) {
|
|
|
|
$argList.Add("-cookcultures=$($var.Cultures -join "+")") > $null
|
|
|
|
}
|
2020-10-06 17:13:37 +01:00
|
|
|
$argList.Add($var.ExtraBuildArguments) > $null
|
2020-10-05 17:42:13 +01:00
|
|
|
|
2020-10-06 12:08:41 +01:00
|
|
|
Write-Output "Building variant: $($var.Name)"
|
2020-10-06 11:40:51 +01:00
|
|
|
|
2020-10-05 17:42:13 +01:00
|
|
|
if ($dryrun) {
|
2020-10-07 12:53:23 +01:00
|
|
|
Write-Output ""
|
2020-10-05 17:42:13 +01:00
|
|
|
Write-Output "Would have run:"
|
2020-10-06 15:52:38 +01:00
|
|
|
Write-Output "> $runUAT $($argList -join " ")"
|
2020-10-07 12:53:23 +01:00
|
|
|
Write-Output ""
|
2020-10-05 17:42:13 +01:00
|
|
|
|
2020-10-05 17:04:41 +01:00
|
|
|
} else {
|
|
|
|
$proc = Start-Process $runUAT $argList -Wait -PassThru -NoNewWindow
|
|
|
|
if ($proc.ExitCode -ne 0) {
|
|
|
|
throw "RunUAT failed!"
|
|
|
|
}
|
2020-10-05 17:42:13 +01:00
|
|
|
|
|
|
|
}
|
2020-10-07 12:53:23 +01:00
|
|
|
|
2023-06-26 16:38:52 +01:00
|
|
|
if ($config.RenameExe.Length -gt 0) {
|
|
|
|
if ($dryrun) {
|
|
|
|
Write-Output "Would have renamed EXE from $($config.Target) to $($config.RenameExe)"
|
|
|
|
} else {
|
|
|
|
# Rename the executable
|
|
|
|
$subdirs = @(Get-ChildItem $outdir)
|
|
|
|
$subdirs | ForEach-Object {
|
|
|
|
$renameExeSuffix = ""
|
|
|
|
if ($var.Platform -like "Win*") {
|
|
|
|
$renameExeSuffix = ".exe"
|
|
|
|
}
|
|
|
|
$exeSrcName = Join-Path $_.FullName "$($config.Target)$renameExeSuffix"
|
|
|
|
$exeDestName = Join-Path $_.FullName "$($config.RenameExe)$renameExeSuffix"
|
|
|
|
Move-Item $exeSrcName $exeDestName -Force
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-09-18 12:50:50 +01:00
|
|
|
if ($var.Configuration -eq "Shipping")
|
|
|
|
{
|
|
|
|
# For shipping, move the PDBs aside but keep them for later use
|
|
|
|
$outDirPDB = "$($outDir)-ShippingPDB"
|
|
|
|
Remove-Item -Path $outDirPDB -Force -ErrorAction SilentlyContinue
|
|
|
|
New-Item -ItemType Directory $outDirPDB -Force > $null
|
|
|
|
|
|
|
|
$pdbs = @(Get-ChildItem -Path $outDir -Filter *.pdb -Recurse -ErrorAction SilentlyContinue -Force)
|
|
|
|
# Need to be in dir to calculate relative
|
|
|
|
Push-Location $outDir
|
|
|
|
$pdbs | ForEach-Object {
|
|
|
|
$pdbdir = Join-Path $outDirPDB $($_.DirectoryName | Resolve-Path -Relative)
|
|
|
|
New-Item -ItemType Directory $pdbdir -Force > $null
|
|
|
|
$pdbdest = Join-Path $outDirPDB $($_.FullName | Resolve-Path -Relative)
|
|
|
|
Move-Item $_.FullName $pdbdest -Force
|
|
|
|
}
|
|
|
|
Pop-Location
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-10-07 12:53:23 +01:00
|
|
|
if ($var.Zip) {
|
|
|
|
if ($dryrun) {
|
|
|
|
Write-Output "Would have compressed $outdir to $(Join-Path $config.ZipDir "$($config.Target)_$($versionNumber)_$($var.Name).zip")"
|
|
|
|
} else {
|
|
|
|
# We zip all subfolders of the out dir separately
|
|
|
|
# Since there may be multiple build dirs in the case of server & client builds
|
|
|
|
# E.g. WindowsNoEditor vs WindowsServer
|
|
|
|
# BUT we omit the folder name in the zip if there's only one, for brevity
|
|
|
|
$subdirs = @(Get-ChildItem $outdir)
|
|
|
|
$multipleBuilds = ($subdirs.Count > 1)
|
|
|
|
$subdirs | ForEach-Object {
|
|
|
|
$zipsrc = "$($_.FullName)\*" # excludes folder name, compress contents
|
|
|
|
$subdirSuffix = ""
|
|
|
|
if ($multipleBuilds) {
|
|
|
|
# Only include "WindowsNoEditor" etc part if there's a need to disambiguate
|
|
|
|
$subdirSuffix = "_$($_.BaseName)"
|
|
|
|
}
|
|
|
|
$zipdst = Join-Path $config.ZipDir "$($config.Target)_$($versionNumber)_$($var.Name)$subdirSuffix.zip"
|
|
|
|
|
|
|
|
New-Item -ItemType Directory -Path $config.ZipDir -Force > $null
|
|
|
|
Write-Output "Compressing to $zipdst"
|
|
|
|
Compress-Archive -Path $zipsrc -DestinationPath $zipdst
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2020-10-05 17:42:13 +01:00
|
|
|
}
|
2020-10-02 18:27:56 +01:00
|
|
|
|
2020-10-14 16:45:03 +01:00
|
|
|
if ($browse -and -not $dryrun) {
|
|
|
|
Invoke-Item $(Join-Path $config.OutputDir $versionNumber)
|
|
|
|
}
|
|
|
|
|
2020-10-02 18:27:56 +01:00
|
|
|
}
|
|
|
|
catch {
|
|
|
|
Write-Output $_.Exception.Message
|
2022-04-19 12:07:09 +01:00
|
|
|
Write-Output "~-~-~ Unreal Packaging Helper FAILED ~-~-~"
|
2020-10-02 18:27:56 +01:00
|
|
|
Exit 9
|
|
|
|
}
|
|
|
|
|
2023-09-18 17:08:25 +01:00
|
|
|
# Revert any remaining temp changes
|
|
|
|
git checkout .
|
2022-04-19 12:07:09 +01:00
|
|
|
Write-Output "~-~-~ Unreal Packaging Helper Completed OK ~-~-~"
|