-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMergeAssemblies.ps1
More file actions
40 lines (30 loc) · 1.4 KB
/
MergeAssemblies.ps1
File metadata and controls
40 lines (30 loc) · 1.4 KB
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
#############################################################################################################
# This script merges the files of the last release build to a single assembly #
#############################################################################################################
function MergeAssemblies
{
param([string] $outputFile, [string] $mainAssembly, [string[]] $refDlls)
$ilmergePath = $PSScriptRoot + "\packages\ILMerge.3.0.41\tools\net452\ILMerge.exe"
if (!(Test-Path($ilmergePath))) {
Write-Error "ILMerge was not found ($ilmergePath)"
return
}
$mergeArgs = @("/out:" + $OutputFile)
$mergeArgs += $mainAssembly
$mergeArgs += $refDlls
Write-Host "Merging Assemblies: "
Write-Host $ilmergePath $mergeArgs
& $ilmergePath $mergeArgs
Write-Host "Finished Merging Assemblies"
}
Clear-Host
$buildConfiguration = "Release"
Write-Host "Build Configuration:"
Write-Host $buildConfiguration -ForegroundColor Yellow
# Goto Output directory
Push-Location ($PSScriptRoot + "\Debwin.UI\bin\" + $buildConfiguration)
# Merge Assemblies to one executable
$referencedDlls = [String[]](Get-ChildItem "*.dll" | Select-Object -ExpandProperty Name) # Get file info of dlls, select names
MergeAssemblies "Debwin4.exe" "Debwin.UI.exe" $referencedDlls
Pop-Location
Write-Host "Debwin4 merge is complete!" -ForegroundColor Green