1
1
param (
2
2
[switch ]$Debug ,
3
- [string ]$VisualStudioVersion = ' 14 .0' ,
3
+ [string ]$VisualStudioVersion = ' 15 .0' ,
4
4
[switch ]$SkipKeyCheck ,
5
- [string ]$Verbosity = ' normal' ,
6
- [string ]$Logger
5
+ [string ]$Verbosity = ' minimal' ,
6
+ [string ]$Logger ,
7
+ [switch ]$Incremental
7
8
)
8
9
9
10
# build the solution
@@ -45,7 +46,12 @@ If (-not (Test-Path $nuget)) {
45
46
}
46
47
47
48
# build the main project
48
- $msbuild = " ${env: ProgramFiles(x86)} \MSBuild\$VisualStudioVersion \Bin\MSBuild.exe"
49
+ $visualStudio = (Get-ItemProperty ' HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7' )." $VisualStudioVersion "
50
+ $msbuild = " $visualStudio \MSBuild\$VisualStudioVersion \Bin\MSBuild.exe"
51
+ If (-not (Test-Path $msbuild )) {
52
+ $host.UI.WriteErrorLine (" Couldn't find MSBuild.exe" )
53
+ exit 1
54
+ }
49
55
50
56
# Attempt to restore packages up to 3 times, to improve resiliency to connection timeouts and access denied errors.
51
57
$maxAttempts = 3
@@ -63,12 +69,23 @@ If ($Logger) {
63
69
$LoggerArgument = " /logger:$Logger "
64
70
}
65
71
66
- & $msbuild ' /nologo' ' /m' ' /nr:false' ' /t:rebuild' $LoggerArgument " /verbosity:$Verbosity " " /p:Configuration=$BuildConfig " " /p:VisualStudioVersion=$VisualStudioVersion " " /p:KeyConfiguration=$KeyConfiguration " $SolutionPath
72
+ If ($Incremental ) {
73
+ $Target = ' build'
74
+ } Else {
75
+ $Target = ' rebuild'
76
+ }
77
+
78
+ & $msbuild ' /nologo' ' /m' ' /nr:false' " /t:$Target " $LoggerArgument " /verbosity:$Verbosity " " /p:Configuration=$BuildConfig " " /p:VisualStudioVersion=$VisualStudioVersion " " /p:KeyConfiguration=$KeyConfiguration " $SolutionPath
67
79
If (-not $? ) {
68
80
$host.ui.WriteErrorLine (' Build failed, aborting!' )
69
81
exit $LASTEXITCODE
70
82
}
71
83
84
+ if ($Incremental ) {
85
+ # Skip NuGet validation and copying packages to the output directory
86
+ exit 0
87
+ }
88
+
72
89
# By default, do not create a NuGet package unless the expected strong name key files were used
73
90
if (-not $SkipKeyCheck ) {
74
91
. .\keys.ps1
0 commit comments