I am supporting a team that is beginning to use TEE to version control their IBM Message Broker Java code through Eclipse. We are doing a POC for automated builds. Currently, I am able to execute (by continuous integration with Team Build) an Ant script to basically "Hello World" when a message flow is checked in to TFS. They want to require a specific build of a Broker project based on what was just checked in as opposed to building all of the Broker projects in the Team Project branch.
First thought was to go grab the list of changesets that kicked off the currently running build since Team Build knows that. However, can't do that with Ant since it isn't "TFS API savvy", so I am trying a little C# console app that I can "exec" from an Ant target prior to the compiling target. The "GetChangeSets" method in the C# app looks like this:
var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(collectionUri);
IBuildServer buildServer = (IBuildServer)projectCollection.GetService(typeof(IBuildServer));
IBuildDetail build = buildServer.GetAllBuildDetails(BuildUri);
List<IChangesetSummary> assocChangesets = InformationNodeConverters.GetAssociatedChangesets(build);
Console.WriteLine("This is the count of changesets from the store: " + assocChangesets.Count);
In the build log for the Ant execution, that writeline is printing this:
This is the count of changesets from the store: 0
I know there is a change so I don't believe that answer. My fear is that the Ant script is running before the Team Build is figuring out the list of associated changesets, and so when my C# app is running there is currently no list. Evidence to that seems to be in the Team Build log, which indicates that the "RunCallAnt:" task is running before the "CoreGetChangesetsAndUpdateWorkItems:" task in the Team Build Log.
Can someone please confirm/ assist on this? Am I missing something in above code to get the changesets? Do I need to somehow modify the standard build process template? Do I need to go calculate my own changesets based on date/time stamps, etc?
Thank you very much in advance for your assistance,
- Moved by Vicky SongMicrosoft employee Wednesday, December 14, 2011 4:05 AM (From:Team Foundation Server - Build Automation)
I am moving your case to the Team Foundation Server - Eclipse and Cross Platform forum as your issue is more related to using Team Foundation Server from Eclipse. You can get better support on that forum.
Vicky Song [MSFT]
MSDN Community Support | Feedback to us
If you got hold of the changeset data what do you plan on doing with it then? There are a few ways of getting this data and trying to figure out the best way...
Alternatively, would it solve your problem easier if you were to do an incremental build in Ant? By only updating the workspace with the source files that had changed between builds Ant would then only build the targets (i.e. the projects) which were dependent on the files that had changed.