简体   繁体   中英

Getting detailed steps in a XAML build definition

I have this old project on a TFS 2017 build server that uses a XAML build definition. I would like to get all the steps that build executes as it seems to build the solution and make some packages.

The TFS admin (not me) can't install any of the plugins, that allow you to export the build... so I'm trying via code

I have the code below at the moment to get the basic info, but I need detailed step/task info so that I can setup a new build that does exactly the same. I can still access the xaml build defenition in VS, but that only says it builds the solution, no other steps.
I got the id of the definition by looping through all definitions for the project first, It doesn't have to be neat code as long I get what I need quick and dirty.

    TfsTeamProjectCollection ttpc2 = new TfsTeamProjectCollection(tfsurl);
    var buildClient = ttpc.GetClient<XamlBuildHttpClient>();
    var defs = buildClient.GetDefinitionsAsync(project: "PROJECT NAME").Result;

    var definition = defs.First(x => x.Id == 22);
    Console.WriteLine("uri: " + definition.Uri);
    Console.WriteLine("name: " + definition.Name);
    Console.WriteLine("id: " + definition.Id + " project id: " + definition.Project.Id);

btw the last build of this definition failed (due to the drop folder being unavailable) and it's also null in the definition I get in code. I can still see all the previous builds on the server. I would have thought that lastbuild would contain either the last successful build or the latest build with a "failed" status or something.

XAML build doesn't have tasks. It's Windows Workflow. There's no way to get the "steps", because a XAML build process template is actually a program. You could run the same build twice and get completely different behavior based on any number of factors.

If you're using an out-of-the-box build process template, you'll discover that the default JSON build/YAML build templates do more or less the same things. If you have a custom build process template, you're going to have to open it up in a XAML editor and read through the code and replicate it as best you can.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM