-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Create the Windows.x64 global tool with shim for signing #21559
Merged
adityapatwardhan
merged 29 commits into
PowerShell:master
from
adityapatwardhan:GblToolSignFix
May 3, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
9b833ca
Add global tool shim packing properties
adityapatwardhan 414425f
Move property to unix project
adityapatwardhan 468cf77
Add pack as tool only for fxdependent on linux
adityapatwardhan 0d7f0eb
Create Windows.x64 global tool in build
adityapatwardhan 63f7a0e
Fix conditional template call
adityapatwardhan 8d71940
Fix typo
adityapatwardhan 872d7f7
Fix issues
adityapatwardhan c264275
Fix version
adityapatwardhan 7fdc904
Fix gci
adityapatwardhan 57f4cfd
Add ipmo and start-psbootstrap
adityapatwardhan b8f0b8c
Fix typo
adityapatwardhan 6dacc20
Fix signing path
adityapatwardhan be4bbac
Add artifact path
adityapatwardhan 3c62453
Manually remove content files
adityapatwardhan 85448da
Restore gallery modules in package
adityapatwardhan f2105af
Fix typo
adityapatwardhan f3ffdd1
Fix package version
adityapatwardhan 5a78705
Pull global tool from build
adityapatwardhan 71c02e3
Remove changes from unix project
adityapatwardhan e29b584
Add some cleanup
adityapatwardhan a3528ad
Add nuspec for properties
adityapatwardhan 721e709
Fix icon file path
adityapatwardhan e77aac0
Add resolve-path
adityapatwardhan 6ecc604
Fix icon file path 2
adityapatwardhan 0845756
Include icon file in package
adityapatwardhan 2b08bb5
Add icon file to folder
adityapatwardhan 589505b
Add icon file to folder 2
adityapatwardhan f23e52c
Remove icon file copy
adityapatwardhan 57c8974
Dont uses nuspec
adityapatwardhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/GlobalTools/PowerShell.Windows.x64/PowerShell.Windows.x64.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<PackAsTool>true</PackAsTool> | ||
<PackAsToolShimRuntimeIdentifiers>win-x64</PackAsToolShimRuntimeIdentifiers> | ||
<ToolCommandName>pwsh</ToolCommandName> | ||
<Version>$(PackageVersion)</Version> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\..\powershell\Program.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" /> | ||
<Content Include="..\..\Modules\Windows\**\*;..\..\Modules\Shared\**\*"> | ||
<Link>Modules\%(RecursiveDir)\%(FileName)%(Extension)</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</Content> | ||
<None Include="Powershell_64.png" Pack="true" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Microsoft.PowerShell.SDK\Microsoft.PowerShell.SDK.csproj" /> | ||
<ProjectReference Include="..\..\Microsoft.PowerShell.Commands.Diagnostics\Microsoft.PowerShell.Commands.Diagnostics.csproj" /> | ||
<ProjectReference Include="..\..\Microsoft.Management.Infrastructure.CimCmdlets\Microsoft.Management.Infrastructure.CimCmdlets.csproj" /> | ||
<ProjectReference Include="..\..\Microsoft.WSMan.Management\Microsoft.WSMan.Management.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4341,20 +4341,22 @@ function New-GlobalToolNupkgSource | |
$toolSettings = $packagingStrings.GlobalToolSettingsFile -f "pwsh.dll" | ||
} | ||
|
||
"PowerShell.Windows.x64" | ||
{ | ||
$PackageName = "PowerShell.Windows.x64" | ||
$RootFolder = New-TempFolder | ||
|
||
Copy-Item -Path $iconPath -Destination "$RootFolder/$iconFileName" -Verbose | ||
|
||
$ridFolder = New-Item -Path (Join-Path $RootFolder "tools/$script:netCoreRuntime/any") -ItemType Directory | ||
|
||
Write-Log "New-GlobalToolNupkgSource: Copying runtime assemblies from $WindowsDesktopBinPath for $PackageType" | ||
Copy-Item "$WindowsDesktopBinPath/*" -Destination $ridFolder -Recurse | ||
Remove-Item -Path $ridFolder/runtimes/win-arm -Recurse -Force | ||
$toolSettings = $packagingStrings.GlobalToolSettingsFile -f "pwsh.dll" | ||
} | ||
# Due to needing a signed shim for the global tool, we build the global tool in build instead of packaging. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove dead code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to keep the code and document why we don't build Windows.x64 here. |
||
# keeping the code for reference. | ||
# "PowerShell.Windows.x64" | ||
# { | ||
# $PackageName = "PowerShell.Windows.x64" | ||
# $RootFolder = New-TempFolder | ||
|
||
# Copy-Item -Path $iconPath -Destination "$RootFolder/$iconFileName" -Verbose | ||
|
||
# $ridFolder = New-Item -Path (Join-Path $RootFolder "tools/$script:netCoreRuntime/any") -ItemType Directory | ||
|
||
# Write-Log "New-GlobalToolNupkgSource: Copying runtime assemblies from $WindowsDesktopBinPath for $PackageType" | ||
# Copy-Item "$WindowsDesktopBinPath/*" -Destination $ridFolder -Recurse | ||
# Remove-Item -Path $ridFolder/runtimes/win-arm -Recurse -Force | ||
# $toolSettings = $packagingStrings.GlobalToolSettingsFile -f "pwsh.dll" | ||
# } | ||
|
||
"PowerShell.Windows.arm32" | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking. We should move any PS Script of significant size into a script or module. This does two things, makes sure they are scanned by static analysis tools and reduces total yaml size.