forked from xamarin/Essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
37 lines (28 loc) · 1.44 KB
/
build.ps1
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
$ErrorActionPreference = "Stop"
$cibuild = "false"
# Make sure that we have something on non-bots
if (!$env:BUILD_NUMBER) {
$env:BUILD_NUMBER = "0"
}
# 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\Current\Bin\MSBuild.exe'
$cibuild = "true"
}
Write-Output "Using MSBuild from: $msbuild"
# Build the projects
& $msbuild "./Xamarin.Essentials.sln" /restore /t:Build /p:Configuration=Release /p:ContinuousIntegrationBuild=$ciBuild /p:Deterministic=false
if ($lastexitcode -ne 0) { exit $lastexitcode; }
# Create the stable NuGet package
& $msbuild "./Xamarin.Essentials/Xamarin.Essentials.csproj" /t:Pack /p:Configuration=Release /p:ContinuousIntegrationBuild=$cibuild /p:Deterministic=false /p:VersionSuffix=".$env:BUILD_NUMBER"
if ($lastexitcode -ne 0) { exit $lastexitcode; }
# Create the beta NuGet package
& $msbuild "./Xamarin.Essentials/Xamarin.Essentials.csproj" /t:Pack /p:Configuration=Release /p:ContinuousIntegrationBuild=$cibuild /p:Deterministic=false /p:VersionSuffix=".$env:BUILD_NUMBER-beta"
if ($lastexitcode -ne 0) { exit $lastexitcode; }
# Copy everything into the output folder
Copy-Item "./Xamarin.Essentials/bin/Release" "./Output" -Recurse -Force
exit $lastexitcode;