Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit 59a9955

Browse files
committed
Update the build and push scripts
1 parent 2647be4 commit 59a9955

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

build/build.ps1

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
param (
22
[switch]$Debug,
3-
[string]$VisualStudioVersion = '14.0',
3+
[string]$VisualStudioVersion = '15.0',
44
[switch]$SkipKeyCheck,
5-
[string]$Verbosity = 'normal',
6-
[string]$Logger
5+
[string]$Verbosity = 'minimal',
6+
[string]$Logger,
7+
[switch]$Incremental
78
)
89

910
# build the solution
@@ -45,7 +46,12 @@ If (-not (Test-Path $nuget)) {
4546
}
4647

4748
# 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+
}
4955

5056
# Attempt to restore packages up to 3 times, to improve resiliency to connection timeouts and access denied errors.
5157
$maxAttempts = 3
@@ -63,12 +69,23 @@ If ($Logger) {
6369
$LoggerArgument = "/logger:$Logger"
6470
}
6571

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
6779
If (-not $?) {
6880
$host.ui.WriteErrorLine('Build failed, aborting!')
6981
exit $LASTEXITCODE
7082
}
7183

84+
if ($Incremental) {
85+
# Skip NuGet validation and copying packages to the output directory
86+
exit 0
87+
}
88+
7289
# By default, do not create a NuGet package unless the expected strong name key files were used
7390
if (-not $SkipKeyCheck) {
7491
. .\keys.ps1

build/keys.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ If ($Version.Contains('-')) {
44

55
# Use the development keys
66
$Keys = @{
7-
'portable-net45' = '71b21a4aa82ae3b3'
7+
'netstandard1.1' = '71b21a4aa82ae3b3'
8+
'net452' = '71b21a4aa82ae3b3'
89
}
910

1011
} Else {
1112

1213
# Use the final release keys
1314
$Keys = @{
14-
'portable-net45' = '2d9feb668c6a0e40'
15+
'netstandard1.1' = '2d9feb668c6a0e40'
16+
'net452' = '2d9feb668c6a0e40'
1517
}
1618

1719
}

build/push.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ If ($Version.EndsWith('-dev')) {
55
Exit 1
66
}
77

8-
..\.nuget\NuGet.exe 'push' ".\nuget\AsyncUsageAnalyzers.$Version.nupkg"
8+
..\.nuget\NuGet.exe 'push' ".\nuget\AsyncUsageAnalyzers.$Version.nupkg" -Source 'https://www.nuget.org/api/v2/package'

0 commit comments

Comments
 (0)