Updated to .NET Framework 4.7.2 due to platform limitations, added email cc, bcc and some fixes.
This commit is contained in:
+60
-47
@@ -1,47 +1,60 @@
|
||||
param(
|
||||
[string]$Configuration = "Release"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$repoRoot = Split-Path -Parent $scriptDir
|
||||
$solutionPath = Join-Path $repoRoot "HostAvailabilityMonitor.sln"
|
||||
|
||||
function Get-MSBuildPath {
|
||||
$msbuildFromPath = Get-Command msbuild.exe -ErrorAction SilentlyContinue
|
||||
if ($msbuildFromPath) {
|
||||
return $msbuildFromPath.Source
|
||||
}
|
||||
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
if (Test-Path $vswhere) {
|
||||
$installationPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
|
||||
if ($installationPath) {
|
||||
$candidate = Join-Path $installationPath "MSBuild\Current\Bin\MSBuild.exe"
|
||||
if (Test-Path $candidate) {
|
||||
return $candidate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw "MSBuild.exe wurde nicht gefunden. Bitte Visual Studio Build Tools oder Visual Studio installieren."
|
||||
}
|
||||
|
||||
$msbuild = Get-MSBuildPath
|
||||
Write-Host "Verwende MSBuild: $msbuild"
|
||||
|
||||
& $msbuild $solutionPath /t:Build /p:Configuration=$Configuration /p:Platform="Any CPU"
|
||||
|
||||
$projectDir = Join-Path $repoRoot "src\HostAvailabilityMonitor"
|
||||
$outputDir = Join-Path $projectDir "bin\$Configuration"
|
||||
$publishDir = Join-Path $repoRoot "artifacts\publish\net48"
|
||||
|
||||
if (Test-Path $publishDir) {
|
||||
Remove-Item -Path $publishDir -Recurse -Force
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Path $publishDir | Out-Null
|
||||
Copy-Item -Path (Join-Path $outputDir "*") -Destination $publishDir -Recurse -Force
|
||||
|
||||
Write-Host "Build abgeschlossen. Publish-Verzeichnis: $publishDir"
|
||||
param(
|
||||
[string]$Configuration = "Release",
|
||||
[switch]$CreateDeploymentPackage
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$repoRoot = Split-Path -Parent $scriptDir
|
||||
$solutionPath = Join-Path $repoRoot "HostAvailabilityMonitor.sln"
|
||||
|
||||
function Get-MSBuildPath {
|
||||
$msbuildFromPath = Get-Command msbuild.exe -ErrorAction SilentlyContinue
|
||||
if ($msbuildFromPath) {
|
||||
return $msbuildFromPath.Source
|
||||
}
|
||||
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
if (Test-Path $vswhere) {
|
||||
$installationPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
|
||||
if ($installationPath) {
|
||||
$candidate = Join-Path $installationPath "MSBuild\Current\Bin\MSBuild.exe"
|
||||
if (Test-Path $candidate) {
|
||||
return $candidate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw "MSBuild.exe wurde nicht gefunden. Bitte Visual Studio Build Tools oder Visual Studio installieren."
|
||||
}
|
||||
|
||||
$msbuild = Get-MSBuildPath
|
||||
Write-Host "Verwende MSBuild: $msbuild"
|
||||
|
||||
& $msbuild $solutionPath /t:Build /p:Configuration=$Configuration /p:Platform="Any CPU"
|
||||
|
||||
$publishRoot = Join-Path $repoRoot "artifacts\publish\net472"
|
||||
if (Test-Path $publishRoot) {
|
||||
Remove-Item -Path $publishRoot -Recurse -Force
|
||||
}
|
||||
New-Item -ItemType Directory -Path $publishRoot | Out-Null
|
||||
|
||||
$projects = @(
|
||||
@{ Name = "HostAvailabilityMonitor"; ProjectDir = Join-Path $repoRoot "src\HostAvailabilityMonitor" },
|
||||
@{ Name = "BizTalkMonitorConfigGenerator"; ProjectDir = Join-Path $repoRoot "src\BizTalkMonitorConfigGenerator" }
|
||||
)
|
||||
|
||||
foreach ($project in $projects) {
|
||||
$outputDir = Join-Path $project.ProjectDir "bin\$Configuration"
|
||||
$targetDir = Join-Path $publishRoot $project.Name
|
||||
New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
|
||||
Copy-Item -Path (Join-Path $outputDir "*") -Destination $targetDir -Recurse -Force
|
||||
Write-Host "Publish-Verzeichnis für $($project.Name): $targetDir"
|
||||
}
|
||||
|
||||
Write-Host "Build abgeschlossen. Publish-Root: $publishRoot"
|
||||
|
||||
if ($CreateDeploymentPackage) {
|
||||
& (Join-Path $scriptDir 'package-deployment.ps1') -PublishRoot '.\artifacts\publish\net472'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user