Skip to content

Try to resolve AppVeyor Ubuntu Errors #1307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions IgnoreInBuildTests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.\Tests\Engine\TestScriptWithFixableWarnings.ps1
.\Tests\Rules\MisleadingBacktick.ps1
29 changes: 17 additions & 12 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -211,27 +214,27 @@ 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
{
$destinationDirBinaries = "$script:destinationDir"
}
6
{
$destinationDirBinaries = "$script:destinationDir\coreclr"
$destinationDirBinaries = "$script:destinationDir/coreclr"
}
default
{
Expand All @@ -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
}
Expand All @@ -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'
}
}

Expand Down
6 changes: 3 additions & 3 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down