PowerShell / PowerShell/PowerShell

Migrate PowerShell.Common.props to Directory.Build.props and Directory.Build.targets

Open
#24,975 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Enhancement Needs-Triage WG-Maintainers-Build WG-NeedsReview
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Summary of the new feature / enhancement

Implements Directory.Build.props and Directory.Build.targets

Required by some msbuild scenarios.
Example : Artifacts output layout

Proposed technical implementation details (optional)

Step 1 : Migrate src directory

  • Create a eng directory to hold specialized msbuild files
  • Replace PowerShell.Common.props with Directory.Build.props and Directory.Build.targets
  • Update projects in src which don't use PowerShell.Common.props in their project file
    • src/GlobalTools/PowerShell.Windows.x64.csproj
    • src/Modules/PSGalleryModules.csproj
    • src/ResGen/ResGen.csproj
    • src/TypeCatalogGen/TypeCatalogGen.csproj
  • in Test directory. Add a Directory.Build.props and Directory.Build.targets with no property/target to block inheritance from the root directory

Step 2 : Migrate test directory

  • Replace test/Test.Common.props with Directory.Build.props and Directory.Build.targets
  • Update projects in test which don't use Test.Common.props in their project file
    • test/perf/dotnet-tools/BenchmarkDotNet.Extensions/BenchmarkDotNet.Extensions.csproj
    • test/perf/dotnet-tools/Reporting/Reporting.csproj
    • test/perf/dotnet-tools/ResultsComparer/ResultsComparer.csproj
    • test/tools/NamedPipeConnection/src/code/Microsoft.PowerShell.NamedPipeConnection.csproj

Step3: Optimize Properties and Targets

  • Merge or Cascading src/Directory.Build.* and test/Directory.Build.* (Opportunity?)
  • Move some properties and targets to eng specialized files. Examples in the dotnet/runtime repository :
    • eng/Analyzers.targets
    • eng/Publishing.props
    • eng/Signing.props
    • eng/Versioning.targets

Step4. Customize MSBuild response file

Examples :

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PowerShell.Common.props, test/Test.Common.props, and the listed .csproj files under src and test. Trace which projects inherit each shared props file before planning the Directory.Build.props and Directory.Build.targets placement. Done means the stated projects use the new directory-based MSBuild files without unintended root inheritance, with specialized files considered under eng.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.