Open weikanglim opened 1 year ago
The new MSBuild CLI Evaluation work might actually make this even easier - I think you'd be able to run a publish command and request specific properties/items from the build, and have that returned back to you in structured form, all without us needing to write any files.
>dotnet publish --os linux --arch x64 -p PublishProfile=DefaultContainer -getProperty GeneratedContainerManifest
{ .... }
This is only coming in .NET 8.0.100 RC2+ at this point though, so it's not immediately usable, and would limit your audience to those with .NET 8 installed. I'm unsure how viable that answer is for you.
Related to https://github.com/Azure/azure-dev/issues/2632
Suppose that a user or tool wants to run
dotnet publish -p:PublishProfile=DefaultContainer
to build the image locally, and then publish it in a subsequent step outside ofdotnet publish
. In this case, it'd be nice for there to be a way to reference the unique image ID produced. Currently, there are output MSBuild task variables present , but it'd be nice to have the reference available outside of being part of MSBuild process.To support an external tool invocation, I could see something like
dotnet publish -p:PublishProfile=DefaultContainer -p:IIDFile=<path>
similar todocker build --iidfile
useful.