Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
Remove comment code
change logic to use existing environment variable when building in VSTS
Remove extraneous suppression of New-FileCatalog
  • Loading branch information
JamesWTruher committed Apr 18, 2020
1 parent e73fa56 commit b3cff98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ END {
if ( $Catalog ) {
$buildArgs['Catalog'] = $true
}
Start-ScriptAnalyzerBuild @buildArgs # -All -Configuration $Configuration -Verbose:$verboseWanted
Start-ScriptAnalyzerBuild @buildArgs
}
"BuildDocumentation" {
Start-ScriptAnalyzerBuild -Documentation -Verbose:$Verbose
Expand Down
10 changes: 4 additions & 6 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,10 @@ function Start-ScriptAnalyzerBuild
$framework,
"--configuration",
"$buildConfiguration"
if ( $env:InVSTS ) {
if ( $env:TF_BUILD ) {
$dotnetArgs += "--output"
$dotnetArgs += "${PSScriptRoot}\bin\${buildConfiguration}\${framework}"
}
# $buildOutput = & $script:DotnetExe build --framework $framework --configuration "$buildConfiguration" 2>&1
$buildOutput = & $script:DotnetExe $dotnetArgs 2>&1
if ( $LASTEXITCODE -ne 0 ) { throw "$buildOutput" }
Write-Verbose -Verbose:$verboseWanted -message "$buildOutput"
Expand All @@ -295,7 +294,7 @@ function Start-ScriptAnalyzerBuild

Publish-File $itemsToCopyCommon $script:destinationDir

if ( $env:InVsts ) {
if ( $env:TF_BUILD ) {
$itemsToCopyBinaries = @(
"$projectRoot\bin\${buildConfiguration}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll",
"$projectRoot\bin\${buildConfiguration}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll"
Expand All @@ -315,7 +314,7 @@ function Start-ScriptAnalyzerBuild
Publish-File $settingsFiles (Join-Path -Path $script:destinationDir -ChildPath Settings)

if ($framework -eq 'net452') {
if ( $env:InVSTS ) {
if ( $env:TF_BUILD ) {
$nsoft = "$projectRoot\bin\${buildConfiguration}\${framework}\Newtonsoft.Json.dll"
}
else {
Expand All @@ -330,9 +329,8 @@ function Start-ScriptAnalyzerBuild

function New-Catalog
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseCompatibleCommands', '')]
param ( [Parameter()]$Location )
$newFileCatalog = Get-Command -ea silentlycontinue New-FileCatalog
$newFileCatalog = Get-Command -ErrorAction SilentlyContinue New-FileCatalog
if ($null -eq $newFileCatalog) {
Write-Warning "New-FileCatalog not found, not creating catalog"
return
Expand Down
14 changes: 0 additions & 14 deletions tools/releaseBuild/AssemblySignConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,4 @@
<file src="__INPATHROOT__\out\PSScriptAnalyzer\1.19.0\PSv3\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll" signType="400" dest="__OUTPATHROOT__\PSScriptAnalyzer\1.19.0\PSv3\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll" />
<file src="__INPATHROOT__\out\PSScriptAnalyzer\1.19.0\PSv3\Microsoft.PowerShell.CrossCompatibility.dll" signType="400" dest="__OUTPATHROOT__\PSScriptAnalyzer\1.19.0\PSv3\Microsoft.PowerShell.CrossCompatibility.dll" />
</job>
<!--
<job platform="" configuration="" dest="__OUTPATHROOT__\signed" jobname="PowerShell Compatibility Analyzer" approvers="vigarg;gstolt">
<file src="__INPATHROOT__\out\PSCompatibilityCollector\PSCompatibilityCollector.psd1" signType="400" dest="__OUTPATHROOT__\PSCompatibilityCollector\PSCompatibilityCollector.psd1" />
<file src="__INPATHROOT__\out\PSCompatibilityCollector\PSCompatibilityCollector.psm1" signType="400" dest="__OUTPATHROOT__\PSCompatibilityCollector\PSCompatibilityCollector.psm1" />
</job>
<job platform="" configuration="" dest="__OUTPATHROOT__\signed" jobname="PowerShell Compatibility Analyzer netstandard2.0 DLLs" approvers="vigarg;gstolt">
<file src="__INPATHROOT__\out\PSCompatibilityCollector\netstandard2.0\Microsoft.PowerShell.CrossCompatibility.dll" signType="400" dest="__OUTPATHROOT__\PSCompatibilityCollector\netstandard2.0\Microsoft.PowerShell.CrossCompatibility.dll" />
<file src="__INPATHROOT__\out\PSCompatibilityCollector\netstandard2.0\Newtonsoft.Json.dll" signType="400" dest="__OUTPATHROOT__\PSCompatibilityCollector\netstandard2.0\Newtonsoft.Json.dll" />
</job>
<job platform="" configuration="" dest="__OUTPATHROOT__\signed" jobname="PowerShell Compatibility Analyzer net452 DLLs" approvers="vigarg;gstolt">
<file src="__INPATHROOT__\out\PSCompatibilityCollector\net452\Microsoft.PowerShell.CrossCompatibility.dll" signType="400" dest="__OUTPATHROOT__\PSCompatibilityCollector\net452\Microsoft.PowerShell.CrossCompatibility.dll" />
<file src="__INPATHROOT__\out\PSCompatibilityCollector\net452\Newtonsoft.Json.dll" signType="400" dest="__OUTPATHROOT__\PSCompatibilityCollector\net452\Newtonsoft.Json.dll" />
</job>
-->
</SignConfigXML>

0 comments on commit b3cff98

Please sign in to comment.