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: 0 additions & 2 deletions .pipelines/templates/windows-hosted-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ jobs:
Where-Object { -not $_.PSIsContainer } |
Where-Object { $_.name -notin $filesToKeep } |
Remove-Item -Verbose


displayName: 'Build Winx64 Global tool'
condition: and(succeeded(), eq(variables['Architecture'], 'fxdependent'))
env:
Expand Down
4 changes: 2 additions & 2 deletions PowerShell.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@
<AppHostDotNetSearch>AppLocal</AppHostDotNetSearch>
</PropertyGroup>

<!-- Enable ready-to-run only for Release configuration -->
<PropertyGroup Condition=" '$(AppDeployment)' == 'SelfContained' And '$(Configuration)' == 'Release' ">
<!-- Enable ready-to-run only for Release configuration except for the min-size build -->
<PropertyGroup Condition=" '$(AppDeployment)' == 'SelfContained' And '$(Configuration)' == 'Release' And '$(ForMinimalSize)' != 'True' ">
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunEmitSymbols>true</PublishReadyToRunEmitSymbols>
</PropertyGroup>
Expand Down
15 changes: 14 additions & 1 deletion assets/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@
</Dependencies>

<Resources>
<Resource Language="en-us"/>
<Resource Language="en-US"/>
<Resource Language="cs"/>
<Resource Language="de"/>
<Resource Language="es"/>
<Resource Language="fr"/>
<Resource Language="it"/>
<Resource Language="ja"/>
<Resource Language="ko"/>
<Resource Language="pl"/>
<Resource Language="pt-BR"/>
<Resource Language="ru"/>
<Resource Language="tr"/>
<Resource Language="zh-Hans"/>
<Resource Language="zh-Hant"/>
</Resources>

<Applications>
Expand Down
30 changes: 24 additions & 6 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ function Start-PSBuild {
Indicates a CI build; restores the Pester module to the output directory.
.PARAMETER ForMinimalSize
Produces a build optimized for minimal binary size (linux-x64, win7-x64, or osx-x64 only).
.PARAMETER ForceProduceLocalizedResources
Forces the build to produce satellite assemblies for all cultures, even when not required.
.PARAMETER SkipExperimentalFeatureGeneration
Skips the step that runs the built pwsh to produce the experimental-features list.
.PARAMETER SMAOnly
Expand Down Expand Up @@ -401,6 +403,7 @@ function Start-PSBuild {
[switch]$NoPSModuleRestore,
[switch]$CI,
[switch]$ForMinimalSize,
[switch]$ForceProduceLocalizedResources,

# Skips the step where the pwsh that's been built is used to create a configuration
# Useful when changing parsing/compilation, since bugs there can mean we can't get past this step
Expand Down Expand Up @@ -553,11 +556,20 @@ Fix steps:
Stop-DevPowerShell
}

# setup arguments
# adding ErrorOnDuplicatePublishOutputFiles=false due to .NET SDk issue: https://github.com/dotnet/sdk/issues/15748
# removing --no-restore due to .NET SDK issue: https://github.com/dotnet/sdk/issues/18999
# $Arguments = @("publish","--no-restore","/property:GenerateFullPaths=true", "/property:ErrorOnDuplicatePublishOutputFiles=false")
$Arguments = @("publish","/property:GenerateFullPaths=true", "/property:ErrorOnDuplicatePublishOutputFiles=false")
# Setup arguments
# Added ErrorOnDuplicatePublishOutputFiles=false due to .NET SDK issue: https://github.com/dotnet/sdk/issues/15748
# Removed the option "--no-restore" due to .NET SDK issue: https://github.com/dotnet/sdk/issues/18999
$Arguments = @("publish", "/property:GenerateFullPaths=true", "/property:ErrorOnDuplicatePublishOutputFiles=false")

# Today, we only support localization for MSIX packages. For Linux and macOS packages, fxdependent and min-size packages,
# as well as .zip packages, we only support the default en-US culture.
# Therefore, we only produce satellite assemblies for win7-x64, win7-x86, and win-arm64 by default (excluding min-size build),
# unless the caller wants to force produce localized resources.
if (!$ForceProduceLocalizedResources -and ($Options.Runtime -notmatch '^(win7-x64|win7-x86|win-arm64)$' -or $ForMinimalSize)) {
# Disable satellite assemblies for other cultures.
$Arguments += "/property:SatelliteResourceLanguages=en"
}

if ($Output -or $SMAOnly) {
$Arguments += "--output", (Split-Path $Options.Output)
}
Expand Down Expand Up @@ -596,7 +608,7 @@ Fix steps:

# We pass in the AppDeployment property to indicate which type of deployment we are doing.
# This allows the PowerShell.Common.props to set the correct properties for the build.
$AppDeployment = if(($Options.Runtime -like 'fxdependent*' -or $ForMinimalSize) -and $Options.Runtime -notmatch $optimizedFddRegex) {
$AppDeployment = if($Options.Runtime -like 'fxdependent*' -and $Options.Runtime -notmatch $optimizedFddRegex) {
# Global and zip files
"FxDependent"
}
Expand All @@ -612,6 +624,12 @@ Fix steps:
}

$Arguments += "/property:AppDeployment=$AppDeployment"

if ($ForMinimalSize) {
# Skip Ready-to-Run compilation in 'PowerShell.Common.props' to keep binary size smaller
$Arguments += "/property:ForMinimalSize=True"
}

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

Expand Down
Loading
Loading