Skip to content
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

Update PSReadLine build to target netstandard2.0 #4584

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Feb 27, 2025

PR Summary

By retargeting PSReadLine to netstandard2.0, we can simplify the build a lot and produce the same assembly no matter building on Windows or non-Windows.

  • Update PSReadLine build to target netstandard2.0, including the CI and release pipeline YAML files.
  • Update the test to target net472 and net6.0, so that we can run tests with both .NET Framework and .NET
  • Rename Microsoft.PowerShell.PSReadLine2.dll to Microsoft.PowerShell.PSReadLine.dll
  • Update and clean up the README.md with the up-to-date information

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure you've added one or more new tests Build changes only
  • Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed at PowerShell-Docs
      • Doc Issue filed:
Microsoft Reviewers: Open in CodeFlow

@daxian-dbw daxian-dbw requested a review from Copilot February 27, 2025 23:52

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR retargets the PSReadLine build to netstandard2.0 to simplify the build process and ensure consistent output across platforms. Key changes include:

  • Updating the build and test commands in various configuration files (README.md, appveyor.yml, pipelines).
  • Renaming the assembly from PSReadLine2.dll to PSReadLine.dll.
  • Adjusting conditional logic in PSReadLine/OnImportAndRemove.cs to reference a netstandard target instead of net462.

Reviewed Changes

File Description
README.md Updated installation, upgrading, and usage instructions.
PSReadLine/OnImportAndRemove.cs Changed assembly resolution logic to target netstandard framework.
.github/CONTRIBUTING.md Updated build instructions to refer to the README section.
appveyor.yml Removed explicit net462 target for Release build; updated test targets.
.pipelines/PSReadLine-Official.yml Updated build and signing steps to use the new assembly name and targets.

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

PSReadLine/OnImportAndRemove.cs:31

  • [nitpick] The literal 'netstd' is ambiguous. Consider renaming it to 'netstandard2_0' or similar for clearer indication of the target framework.
string subd = (Environment.Version.Major >= 6) ? "net6plus" : "netstd";
@daxian-dbw daxian-dbw merged commit 49604e8 into PowerShell:master Feb 28, 2025
2 checks passed
@daxian-dbw daxian-dbw deleted the netstd branch February 28, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant