_WalkEachTargetPerFramework (Pack) should list inner builds the same way as during the build step #10556
Labels
Functionality:Pack
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Type:Feature
Issue
_WalkEachTargetPerFramework
(used to list files for each TFM duringPack
) is currently enumerating builds to pack with only the hardcoded case ofTargetFrameworks
in mind (Projects="$(MSBuildProjectFullPath)"
andTargetFramework=%(_TargetFrameworks.Identity)
).This makes it quite difficult to extend, and is separate from the build dispatch (done by
_ComputeTargetFrameworkItems
).Example use case
MSBuild.Sdk.Extras
for building one library per RIDProposal:
Unify the build dispatch and packing by reusing the same list,
@(_InnerBuildProjects)
instead.It is computed during
Build
in_ComputeTargetFrameworkItems
.On top of keeping build and pack in sync, it allows for much easier extensibility (current workaround is to do a full copy & paste of
_WalkEachTargetPerFramework
and all its sub targets).Excerpt of
_WalkEachTargetPerFramework
before the change:After:
(
_InnerBuildProjects
already contains theAdditionalProperties
withTargetFramework
properly set. The cool thing is that we can easily add custom ones such asRuntimeIdentifier=win-x64
, this will affect bothBuild
andPack
)Do you think of any case where this wouldn't work?
If everybody agrees, I am happy to submit a PR for that.
Note: this is just the first step. About the use case described earlier (multiple DLL per RID or graphics API rather than only by TFM), there's still a bunch of other tedious changes & target overrides to do.
I plan to submit other PRs later to improve on that (if they are welcome, I am not sure it's a priority).
The text was updated successfully, but these errors were encountered: