11param (
22 [switch ]$Debug ,
33 [string ]$VisualStudioVersion = ' 15.0' ,
4- [switch ]$SkipKeyCheck ,
54 [string ]$Verbosity = ' minimal' ,
65 [string ]$Logger ,
76 [switch ]$Incremental
@@ -16,20 +15,12 @@ if (!(Test-Path $SolutionPath)) {
1615 exit 1
1716}
1817
19- . .\version.ps1
20-
2118If ($Debug ) {
2219 $BuildConfig = ' Debug'
2320} Else {
2421 $BuildConfig = ' Release'
2522}
2623
27- If ($Version.Contains (' -' )) {
28- $KeyConfiguration = ' Dev'
29- } Else {
30- $KeyConfiguration = ' Final'
31- }
32-
3324# download nuget.exe if necessary
3425$nuget = ' ..\.nuget\nuget.exe'
3526If (-not (Test-Path $nuget )) {
@@ -75,43 +66,8 @@ If ($Incremental) {
7566 $Target = ' rebuild'
7667}
7768
78- & $msbuild ' /nologo' ' /m' ' /nr:false' " /t:$Target " $LoggerArgument " /verbosity:$Verbosity " " /p:Configuration=$BuildConfig " " /p:VisualStudioVersion=$VisualStudioVersion " " /p:KeyConfiguration= $KeyConfiguration " $SolutionPath
69+ & $msbuild ' /nologo' ' /m' ' /nr:false' " /t:$Target " $LoggerArgument " /verbosity:$Verbosity " " /p:Configuration=$BuildConfig " " /p:VisualStudioVersion=$VisualStudioVersion " $SolutionPath
7970If (-not $? ) {
8071 $host.ui.WriteErrorLine (' Build failed, aborting!' )
8172 exit $LASTEXITCODE
8273}
83-
84- if ($Incremental ) {
85- # Skip NuGet validation and copying packages to the output directory
86- exit 0
87- }
88-
89- # By default, do not create a NuGet package unless the expected strong name key files were used
90- if (-not $SkipKeyCheck ) {
91- . .\keys.ps1
92-
93- foreach ($pair in $Keys.GetEnumerator ()) {
94- $assembly = Resolve-FullPath - Path " ..\StyleCop.Analyzers\StyleCop.Analyzers.CodeFixes\bin\$BuildConfig \$ ( $pair.Key ) \StyleCop.Analyzers.dll"
95- # Run the actual check in a separate process or the current process will keep the assembly file locked
96- powershell - Command " .\check-key.ps1 -Assembly '$assembly ' -ExpectedKey '$ ( $pair.Value ) ' -Build '$ ( $pair.Key ) '"
97- If (-not $? ) {
98- $host.ui.WriteErrorLine (' Failed to verify strong name key for build, aborting!' )
99- exit $LASTEXITCODE
100- }
101-
102- $assembly = Resolve-FullPath - Path " ..\StyleCop.Analyzers\StyleCop.Analyzers.CodeFixes\bin\$BuildConfig \$ ( $pair.Key ) \StyleCop.Analyzers.CodeFixes.dll"
103- # Run the actual check in a separate process or the current process will keep the assembly file locked
104- powershell - Command " .\check-key.ps1 -Assembly '$assembly ' -ExpectedKey '$ ( $pair.Value ) ' -Build '$ ( $pair.Key ) '"
105- If (-not $? ) {
106- $host.ui.WriteErrorLine (' Failed to verify strong name key for build, aborting!' )
107- exit $LASTEXITCODE
108- }
109- }
110- }
111-
112- if (-not (Test-Path ' nuget' )) {
113- mkdir " nuget"
114- }
115-
116- Copy-Item " ..\StyleCop.Analyzers\StyleCop.Analyzers.CodeFixes\bin\$BuildConfig \StyleCop.Analyzers.$Version .nupkg" ' nuget'
117- Copy-Item " ..\StyleCop.Analyzers\StyleCop.Analyzers.CodeFixes\bin\$BuildConfig \StyleCop.Analyzers.$Version .symbols.nupkg" ' nuget'
0 commit comments