Skip to content

Commit c9bcf3b

Browse files
committed
chore(build.ps1): remove obsolete build scripts
1 parent 26573a3 commit c9bcf3b

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

Build.ps1

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,5 @@
1-
<#
2-
.SYNOPSIS
3-
You can add this to you build script to ensure that psbuild is available before calling
4-
Invoke-MSBuild. If psbuild is not available locally it will be downloaded automatically.
5-
#>
6-
function EnsurePsbuildInstalled{
7-
[cmdletbinding()]
8-
param(
9-
[string]$psbuildInstallUri = 'https://raw.githubusercontent.com/ligershark/psbuild/master/src/GetPSBuild.ps1'
10-
)
11-
process{
12-
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
13-
'Installing psbuild from [{0}]' -f $psbuildInstallUri | Write-Verbose
14-
(new-object Net.WebClient).DownloadString($psbuildInstallUri) | iex
15-
}
16-
else{
17-
'psbuild already loaded, skipping download' | Write-Verbose
18-
}
19-
20-
# make sure it's loaded and throw if not
21-
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
22-
throw ('Unable to install/load psbuild from [{0}]' -f $psbuildInstallUri)
23-
}
24-
}
25-
}
26-
27-
# Taken from psake https://github.com/psake/psake
28-
29-
<#
30-
.SYNOPSIS
31-
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
32-
to see if an error occcured. If an error is detected then an exception is thrown.
33-
This function allows you to run command-line programs without having to
34-
explicitly check the $lastexitcode variable.
35-
.EXAMPLE
36-
exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
37-
#>
38-
function Exec
39-
{
40-
[CmdletBinding()]
41-
param(
42-
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
43-
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd)
44-
)
45-
& $cmd
46-
if ($lastexitcode -ne 0) {
47-
throw ("Exec: " + $errorMessage)
48-
}
49-
}
50-
51-
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
52-
53-
EnsurePsbuildInstalled
54-
551
exec { & dotnet restore .\src\JsonApiDotNetCore\JsonApiDotNetCore.csproj }
562

57-
#Invoke-MSBuild
58-
593
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
604
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)
615

0 commit comments

Comments
 (0)