Skip to content
Merged
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: 1 addition & 1 deletion PowerShell.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
<IsWindows Condition="'$(OS)' == 'Windows_NT'">true</IsWindows>
<IsWindows Condition="'$(IsWindows)' =='true' or ( '$(IsWindows)' == '' and '$(OS)' == 'Windows_NT')">true</IsWindows>
</PropertyGroup>

<!-- Define non-windows, all configuration properties -->
Expand Down
44 changes: 29 additions & 15 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ function Start-PSBuild {

[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
[ValidateNotNullOrEmpty()]
[string]$ReleaseTag
[string]$ReleaseTag,
[switch]$Detailed
)

if ($PsCmdlet.ParameterSetName -eq "Default" -and !$NoPSModuleRestore)
Expand Down Expand Up @@ -327,10 +328,22 @@ Fix steps:
$Arguments += "--output", (Split-Path $Options.Output)
}

if ($Options.Runtime -like 'win*' -or ($Options.Runtime -eq 'fxdependent' -and $Environment.IsWindows)) {
$Arguments += "/property:IsWindows=true"
}
else {
$Arguments += "/property:IsWindows=false"
}

$Arguments += "--configuration", $Options.Configuration
$Arguments += "--framework", $Options.Framework

if (-not $SMAOnly -and $Options.Runtime -ne 'fxdependent') {
if ($Detailed.IsPresent)
{
$Arguments += '--verbosity', 'd'
}

if (-not $SMAOnly -and $Options.Runtime -notlike 'fxdependent*') {
# libraries should not have runtime
$Arguments += "--runtime", $Options.Runtime
}
Expand Down Expand Up @@ -653,19 +666,6 @@ function New-PSOptions {
}
Write-Verbose "Using configuration '$Configuration'"

$PowerShellDir = if (!$Environment.IsWindows) {
"powershell-unix"
} else {
"powershell-win-core"
}
$Top = [IO.Path]::Combine($PSScriptRoot, "src", $PowerShellDir)
Write-Verbose "Top project directory is $Top"

if (-not $Framework) {
$Framework = "netcoreapp2.1"
Write-Verbose "Using framework '$Framework'"
}

if (-not $Runtime) {
if ($Environment.IsLinux) {
$Runtime = "linux-x64"
Expand All @@ -691,6 +691,20 @@ function New-PSOptions {
}
}

$PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -eq 'fxdependent' -and $Environment.IsWindows)) {
"powershell-win-core"
} else {
"powershell-unix"
}

$Top = [IO.Path]::Combine($PSScriptRoot, "src", $PowerShellDir)
Write-Verbose "Top project directory is $Top"

if (-not $Framework) {
$Framework = "netcoreapp2.1"
Write-Verbose "Using framework '$Framework'"
}

$Executable = if ($Runtime -eq 'fxdependent') {
"pwsh.dll"
} elseif ($Environment.IsLinux -or $Environment.IsMacOS) {
Expand Down
6 changes: 4 additions & 2 deletions test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,13 @@ function ValidateSaveHelp

$compressedFile = GetFiles -fileType "*$extension" -path $path | ForEach-Object {Split-Path $_ -Leaf}
$expectedCompressedFile = $testCases[$moduleName].CompressedFiles
$expectedCompressedFile | Should -Be $compressedFile
$expectedCompressedFile | Should -Not -BeNullOrEmpty -Because "Test data (expectedCompressedFile) should never be null"
$compressedFile | Should -Be $expectedCompressedFile -Because "Save-Help for $module should download '$expectedCompressedFile'"

$helpInfoFile = GetFiles -fileType "*HelpInfo.xml" -path $path | ForEach-Object {Split-Path $_ -Leaf}
$expectedHelpInfoFile = $testCases[$moduleName].HelpInfoFiles
$expectedHelpInfoFile | Should -Be $helpInfoFile
$expectedHelpInfoFile | Should -Not -BeNullOrEmpty -Because "Test data (expectedHelpInfoFile) should never be null"
$helpInfoFile | Should -Be $expectedHelpInfoFile -Because "Save-Help for $module should download '$expectedHelpInfoFile'"
}

Describe "Validate Update-Help from the Web for one PowerShell Core module." -Tags @('CI', 'RequireAdminOnWindows', 'RequireSudoOnUnix') {
Expand Down