forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvscode-build.ps1
More file actions
25 lines (21 loc) · 781 Bytes
/
vscode-build.ps1
File metadata and controls
25 lines (21 loc) · 781 Bytes
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
param (
[Parameter(Mandatory = $true)][string]$filePath,
[string]$msbuildEngine = "vs",
[string]$framework = ""
)
Set-StrictMode -version 3.0
$ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot "../eng/build-utils.ps1")
$fileInfo = Get-ItemProperty $filePath
$projectFileInfo = Get-ProjectFile $fileInfo
if ($projectFileInfo) {
$buildTool = InitializeBuildTool
$frameworkArg = if ($framework -ne "") { " -p:TargetFramework=$framework" } else { "" }
$buildArgs = "$($buildTool.Command) -v:m -tl:off -m -p:RunAnalyzersDuringBuild=false -p:GenerateFullPaths=true$frameworkArg $($projectFileInfo.FullName)"
Exec-Command $buildTool.Path $buildArgs
exit 0
}
else {
Write-Host "Failed to build project. $fileInfo is not part of a C# / VB project."
exit 1
}