Improve build configuration

parent 1ee2989e
Pipeline #36 passed with stages
in 3 minutes and 17 seconds
stages:
- Build
- Documentation
- Package
Build Solution:
NET Framework 4.0:
stage: Build
script: "powershell .\\Build.ps1 NChronicle.SMTP.sln"
\ No newline at end of file
script: "nuget restore & msbuild NChronicle.SMTP_NetFx.csproj /p:Configuration=Release"
artifacts:
paths:
- bin/Release/netfx4.0/
NET Standard 2.0:
stage: Build
script: "dotnet build NChronicle.SMTP_NetStandard.csproj -c Release"
artifacts:
paths:
- bin/Release/netstandard2.0/
Documentation:
stage: Documentation
script: "msbuild NChronicle.SMTP.shfbproj /p:Configuration=Release"
dependencies:
- NET Framework 4.0
artifacts:
paths:
- _Wiki/
Package:
stage: Package
script: "nuget pack NChronicle.SMTP.nuspec"
dependencies:
- NET Framework 4.0
- NET Standard 2.0
artifacts:
paths:
- NChronicle.SMTP.*.nupkg
Param([string] $target, [string] $msbuild)
$PROGRAM_FILES_32 = ${env:ProgramFiles(x86)}
$DEFAULT_LOCATION_FOR_BUILDTOOLS = "$PROGRAM_FILES_32\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe"
$DEFAULT_LOCATION_FOR_VS_COMMUNITY = "$PROGRAM_FILES_32\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
$DEFAULT_LOCATION_FOR_VS_PROFESSIONAL = "$PROGRAM_FILES_32\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"
$DEFAULT_LOCATION_FOR_VS_ENTERPRISE = "$PROGRAM_FILES_32\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
if (![String]::IsNullOrEmpty($msbuild)) {
if (-not (Test-Path $msbuild)) {
Throw [System.IO.FileNotFoundException] "The path $msbuild was invalid or the file did not exist."
}
} else {
$msbuild = $DEFAULT_LOCATION_FOR_BUILDTOOLS
if (-not (Test-Path $msbuild)) {
$msbuild = $DEFAULT_LOCATION_FOR_VS_COMMUNITY
}
if (-not (Test-Path $msbuild)) {
$msbuild = $DEFAULT_LOCATION_FOR_VS_PROFESSIONAL
}
if (-not (Test-Path $msbuild)) {
$msbuild = $DEFAULT_LOCATION_FOR_VS_ENTERPRISE
}
if (-not (Test-Path $msbuild)) {
Throw [System.IO.FileNotFoundException] "Could not find a C# 7 MSBuild tool."
}
}
&$msbuild $target
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment