Open oats4goats opened 2 months ago
You'd need to ask the traversal SDK folks why the target isn't forwarded along to the child projects.
Got it! Thanks. Will report back.
Great! Interested in hearing what they think - in general if an action works for a solution we should be able to support it for a traversal project as well.
@jeffkl I'm guessing this is because the Traversal targets have explicit support for a key set of MSBuild targets that they forward along to ProjectReferences, and the PublishContainer
target isn't one of those. That sound about right?
@baronfel that is correct, only a handful of targets are implemented in Traversal: https://github.com/microsoft/MSBuildSdks/blob/main/src/Traversal/Sdk/Traversal.targets#L135-L284
When building a solution, MSBuild generates a metaproj on-the-fly and any target not already declared it dynamically generates one for. I wonder if MSBuild should have a feature to do this for Traversal projects as well?
But it wouldn't be that hard to add the PublishContainer
target to Traversal either. Someone just needs to do it.
Hey!
I use a .proj file in the root (generated by dotnet-affected tooling) to build and publish the affected projects in my tree.
I'm now exploring the PublishContainer target for my CI pipeline. And it seems to be checking isPublishable and EnableSdkContainerSupport props in the said .proj file (in the root) which are false by default and then skips publishing the containers altogether without traversing the tree.
Publishing the projects inside the tree works just fine. Is it an intended behavior?
Thanks for looking into this!
-- MItya