From da2c3eb50822310f281e41bd48aa1a576a1f4479 Mon Sep 17 00:00:00 2001 From: "Bevan, John - Technical Architect" Date: Sat, 10 Aug 2019 13:32:34 +0100 Subject: [PATCH] try to resolve AppVeyor Ubuntu Errors --- IgnoreInBuildTests.txt | 2 ++ build.psm1 | 29 +++++++++++++++++------------ tools/appveyor.psm1 | 6 +++--- 3 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 IgnoreInBuildTests.txt diff --git a/IgnoreInBuildTests.txt b/IgnoreInBuildTests.txt new file mode 100644 index 000000000..3a282d1a9 --- /dev/null +++ b/IgnoreInBuildTests.txt @@ -0,0 +1,2 @@ +.\Tests\Engine\TestScriptWithFixableWarnings.ps1 +.\Tests\Rules\MisleadingBacktick.ps1 diff --git a/build.psm1 b/build.psm1 index b7bffba05..90391ae0b 100644 --- a/build.psm1 +++ b/build.psm1 @@ -101,6 +101,7 @@ function Remove-Build # Build documentation using platyPS function Start-DocumentationBuild { + Write-Verbose -Verbose -Message "Buidling Documentation" $docsPath = Join-Path $projectRoot docs $markdownDocsPath = Join-Path $docsPath markdown $outputDocsPath = Join-Path $script:destinationDir en-US @@ -123,6 +124,7 @@ function Start-DocumentationBuild function Copy-CompatibilityProfiles { + Write-Verbose -Verbose -Message "Copying Compatibility Profiles" if ($PSVersionTable.PSVersion.Major -le 5) { Add-Type -AssemblyName 'System.IO.Compression.FileSystem' @@ -156,6 +158,7 @@ function Start-ScriptAnalyzerBuild ) BEGIN { + Write-Verbose "Running ScriptAnalyzerBuild for $PSVersion" # don't allow the build to be started unless we have the proper Cli version # this will not actually install dotnet if it's already present, but it will # install the proper version @@ -169,7 +172,7 @@ function Start-ScriptAnalyzerBuild END { # Build docs either when -Documentation switch is being specified or the first time in a clean repo - $documentationFileExists = Test-Path (Join-Path $PSScriptRoot 'out\PSScriptAnalyzer\en-us\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml') + $documentationFileExists = Test-Path (Join-Path $PSScriptRoot 'out/PSScriptAnalyzer/en-us/Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml') if ( $Documentation -or -not $documentationFileExists ) { Start-DocumentationBuild @@ -211,19 +214,19 @@ function Start-ScriptAnalyzerBuild } $itemsToCopyCommon = @( - "$projectRoot\Engine\PSScriptAnalyzer.psd1", "$projectRoot\Engine\PSScriptAnalyzer.psm1", - "$projectRoot\Engine\ScriptAnalyzer.format.ps1xml", "$projectRoot\Engine\ScriptAnalyzer.types.ps1xml" + "$projectRoot/Engine/PSScriptAnalyzer.psd1", "$projectRoot/Engine/PSScriptAnalyzer.psm1", + "$projectRoot/Engine/ScriptAnalyzer.format.ps1xml", "$projectRoot/Engine/ScriptAnalyzer.types.ps1xml" ) switch ($PSVersion) { 3 { - $destinationDirBinaries = "$script:destinationDir\PSv3" + $destinationDirBinaries = "$script:destinationDir/PSv3" } 4 { - $destinationDirBinaries = "$script:destinationDir\PSv4" + $destinationDirBinaries = "$script:destinationDir/PSv4" } 5 { @@ -231,7 +234,7 @@ function Start-ScriptAnalyzerBuild } 6 { - $destinationDirBinaries = "$script:destinationDir\coreclr" + $destinationDirBinaries = "$script:destinationDir/coreclr" } default { @@ -246,6 +249,7 @@ function Start-ScriptAnalyzerBuild try { Push-Location $projectRoot/Rules Write-Progress "Building ScriptAnalyzer for PSVersion '$PSVersion' using framework '$framework' and configuration '$Configuration'" + Write-Verbose -Verbose -Message "Building ScriptAnalyzer for PSVersion '$PSVersion' using framework '$framework' and configuration '$Configuration'" if ( -not $script:DotnetExe ) { $script:DotnetExe = Get-DotnetExe } @@ -260,24 +264,25 @@ function Start-ScriptAnalyzerBuild finally { Pop-Location } - + Write-Verbose -Verbose -Message "Publishing build artifacts" Publish-File $itemsToCopyCommon $script:destinationDir $itemsToCopyBinaries = @( - "$projectRoot\Engine\bin\${config}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll", - "$projectRoot\Rules\bin\${config}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll" - "$projectRoot\Rules\bin\${config}\${framework}\Microsoft.PowerShell.CrossCompatibility.dll" + "$projectRoot/Engine/bin/${config}/${Framework}/Microsoft.Windows.PowerShell.ScriptAnalyzer.dll", + "$projectRoot/Rules/bin/${config}/${Framework}/Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll" + "$projectRoot/Rules/bin/${config}/${framework}/Microsoft.PowerShell.CrossCompatibility.dll" ) Publish-File $itemsToCopyBinaries $destinationDirBinaries - $settingsFiles = Get-Childitem "$projectRoot\Engine\Settings" | ForEach-Object -MemberName FullName + $settingsFiles = Get-Childitem "$projectRoot/Engine/Settings" | ForEach-Object -MemberName FullName Publish-File $settingsFiles (Join-Path -Path $script:destinationDir -ChildPath Settings) if ($framework -eq 'net452') { - Copy-Item -path "$projectRoot\Rules\bin\${config}\${framework}\Newtonsoft.Json.dll" -Destination $destinationDirBinaries + Copy-Item -path "$projectRoot/Rules/bin/${config}/${framework}/Newtonsoft.Json.dll" -Destination $destinationDirBinaries } Pop-Location + Write-Verbose -Verbose -Message 'ScriptAnalyzerBuild completed' } } diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 65dd71304..e374bd9b1 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -33,9 +33,9 @@ function Invoke-AppVeyorInstall { # the build script sorts out the problems of WMF4 and earlier versions of dotnet CLI Write-Verbose -Verbose "Installing required .Net CORE SDK" - Write-Verbose "& $buildScriptDir/build.ps1 -bootstrap" - $buildScriptDir = (Resolve-Path "$PSScriptRoot/..").Path - & "$buildScriptDir/build.ps1" -bootstrap + $buildScriptDir = (Resolve-Path (Join-Path (Join-Path $PSScriptRoot '..') 'build.ps1')).Path + Write-Verbose -Verbose -Message "& $buildScriptDir -bootstrap" + & $buildScriptDir -bootstrap } # Implements AppVeyor 'test_script' step