Merge pull request #58 from mattleibow/add-build

Added a build script for CI bots
This commit is contained in:
Matthew Leibowitz 2018-03-04 23:54:28 +02:00 коммит произвёл GitHub
Родитель efda119051 770394c43a
Коммит 2927301b5a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 30 добавлений и 1 удалений

Просмотреть файл

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace Microsoft.Caboodle.Types namespace Microsoft.Caboodle
{ {
public static partial class LocationExtensions public static partial class LocationExtensions
{ {

29
build.ps1 Normal file
Просмотреть файл

@ -0,0 +1,29 @@
$ErrorActionPreference = "Stop"
# Find MSBuild on this machine
if ($IsMacOS) {
$msbuild = "msbuild"
} else {
$vswhere = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe'
$msbuild = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
$msbuild = join-path $msbuild 'MSBuild\15.0\Bin\MSBuild.exe'
}
Write-Output "Using MSBuild from: $msbuild"
# Build the projects
& $msbuild "./Caboodle.sln" /t:"Restore;Build" /p:Configuration=Release
if ($lastexitcode -ne 0) { exit $lastexitcode; }
# Create the stable NuGet package
& $msbuild "./Caboodle/Caboodle.csproj" /t:Pack /p:Configuration=Release /p:VersionSuffix=".$env:BUILD_NUMBER"
if ($lastexitcode -ne 0) { exit $lastexitcode; }
# Create the beta NuGet package
& $msbuild "./Caboodle/Caboodle.csproj" /t:Pack /p:Configuration=Release /p:VersionSuffix=".$env:BUILD_NUMBER-beta"
if ($lastexitcode -ne 0) { exit $lastexitcode; }
# Copy everything into the output folder
Copy-Item "./Caboodle/bin/Release" "./Output" -Recurse -Force
exit $lastexitcode;