NuGet Support for CAKE Build Scripts
We're using C# Make (CAKE) to run our builds, including nuget restore and pack. We would like to be able to show the nuget dependencies and outputs resulting from the build process in the same way that the TeamCity NuGget build step works.
Is there a way to write the output of the nuget restore process to TeamCity and have it produce the menu items in the build results?
Please sign in to leave a comment.
Hi,
This will depend on how you are running the build. CAKE is not a bundled plugin, so I'm not aware of what the plugin is doing. The bundle NuGet runners generate this information through the plugin that runs the steps, so you could always create your own plugin and post the information based on the information you have available during the build.
Thank Denis,
Are you suggesting that there are service messages similar to "##teamcity[buildNumber '{versionString}']" that we could output in order to get the build to display nuget version dependencies? If so, Is there somewhere that would describe how to generate messages that would populate the NuGet Pagkages tab?
Maybe you're suggesting that the plug-in would provide it's own tab directly in place of the NuGet packages tab?
Just FYI, we're currently executing the restore target using MSBuild with CAKE as such. I don't think that TeamCity has fully integrated with the MSBuild restore target using <packagereference>. Ideally we could just piggyback of of that when invoking MSBuild.
Thoughts?
Lennon
`Task("Restore")
.Does(() =>
{
MSBuild(solution, settings =>
{
settings
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.SetPlatformTarget(PlatformTarget.MSIL)
.WithTarget("Restore");
settings.ArgumentCustomization = args=>args.Append($"/p:RestoreConfigFile={nuget}");
});
});`
Hi,
no, there aren't service messages (so far) to add nuget dependency information. But plugins do have a control over adding new tabs to the build results, and which information is displayed on them.
Another, maybe easier option, could be to bring the nuget steps out of the cmake script, and make them independent, so that TeamCity can gather the information with its current available features.