2018-03-05 00:42:40 +03:00
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
2018-03-05 20:14:23 +03:00
|
|
|
# Make sure that we have something on non-bots
|
|
|
|
if (!$env:BUILD_NUMBER) {
|
|
|
|
$env:BUILD_NUMBER = "0"
|
|
|
|
}
|
|
|
|
|
2018-03-05 00:42:40 +03:00
|
|
|
# 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
|
2018-04-06 03:46:34 +03:00
|
|
|
& $msbuild "./Xamarin.Essentials.sln" /t:"Restore;Build" /p:Configuration=Release
|
2018-03-05 00:42:40 +03:00
|
|
|
if ($lastexitcode -ne 0) { exit $lastexitcode; }
|
|
|
|
|
|
|
|
# Create the stable NuGet package
|
2018-04-06 03:46:34 +03:00
|
|
|
& $msbuild "./Xamarin.Essentials/Xamarin.Essentials.csproj" /t:Pack /p:Configuration=Release /p:VersionSuffix=".$env:BUILD_NUMBER"
|
2018-03-05 00:42:40 +03:00
|
|
|
if ($lastexitcode -ne 0) { exit $lastexitcode; }
|
|
|
|
|
|
|
|
# Create the beta NuGet package
|
2018-04-06 03:46:34 +03:00
|
|
|
& $msbuild "./Xamarin.Essentials/Xamarin.Essentials.csproj" /t:Pack /p:Configuration=Release /p:VersionSuffix=".$env:BUILD_NUMBER-beta"
|
2018-03-05 00:42:40 +03:00
|
|
|
if ($lastexitcode -ne 0) { exit $lastexitcode; }
|
|
|
|
|
|
|
|
# Copy everything into the output folder
|
2018-04-06 03:46:34 +03:00
|
|
|
Copy-Item "./Xamarin.Essentials/bin/Release" "./Output" -Recurse -Force
|
2018-03-05 00:42:40 +03:00
|
|
|
|
|
|
|
exit $lastexitcode;
|