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

PublishContainer doesn't traverse the project tree (Microsoft.Build.Traversal) #594

Open
oats4goats opened this issue Sep 4, 2024 · 5 comments
Labels
Area: Integrations Work done to integrate with other tools, especially IDE tooling blocked

Comments

@oats4goats
Copy link

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

@oats4goats oats4goats changed the title PublishContainer doesnt'r traverse the project tree (Microsoft.Build.Traversal) PublishContainer doesn't traverse the project tree (Microsoft.Build.Traversal) Sep 4, 2024
@baronfel
Copy link
Member

baronfel commented Sep 4, 2024

You'd need to ask the traversal SDK folks why the target isn't forwarded along to the child projects.

@oats4goats
Copy link
Author

Got it! Thanks. Will report back.

@baronfel
Copy link
Member

baronfel commented Sep 4, 2024

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.

@baronfel baronfel added Area: Integrations Work done to integrate with other tools, especially IDE tooling blocked labels Oct 9, 2024
@baronfel
Copy link
Member

baronfel commented Oct 9, 2024

@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?

@jeffkl
Copy link

jeffkl commented Oct 9, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Integrations Work done to integrate with other tools, especially IDE tooling blocked
Projects
None yet
Development

No branches or pull requests

3 participants