Reputation: 4375
We have a custom build activity, which performs the execution of our build. We use a custom activity, because the compilers we use are very special and the system is quite old and we do not want to rewrite the whole thing so that it works with MSBuild. However, the repository is managed by TFS and the build shall be triggered by TFS.
Inside the custom build activity, I would like to log the status. Currently, I'm doing this with this piece of C# code:
private void LogMessage(String message, CodeActivityContext context)
{
BuildInformationRecord<BuildMessage> record =
new BuildInformationRecord<BuildMessage>()
{
Value = new BuildMessage()
{
Importance = BuildMessageImportance.High,
Message = message,
},
};
context.Track(record);
}
It works, however there is one big problem: Our custom build activity takes about 6 hours for execution (as I said, it's an old and also large software project). The problem is that the log messages only appear inside TFS build summary once the build action has completed. So after 6 hours of building, all the log messages appear at once.
What we would like to have is that the messages are shown as they are logged. So that the build guy can see where the build currently is, and also see what happened.
One workaround I implemented so far is to have the custom build activity use a Queue of Messages which is shared with the workflow foundation part. Then, inside workflow foundation, I created a parallel statement which executes the build and at the same time empties the queue of messages and displays them. Here is a screenshot of that construct:
However, the result is pretty disappointing. This is what comes out:
The red one is the actual build log message, everything around it is just the while loop and the other things...
Is it possible to switch those log messages off?
Upvotes: 1
Views: 1920
Reputation: 91
mtbwt:BuildTrackingParticipant.Importance="Low"/"None"
only controls the call (I guess). Instead use mtbwt:BuildTrackingParticipant.TrackingOption="None"
, which seems to get completely rid of all tracking messages in the call.
Upvotes: 1
Reputation: 52798
You could try setting the following attribute on the Build Process Template XAML (cannot be done via the designer) to suppress the messages:
mtbwt:BuildTrackingParticipant.Importance="None"
example from my template:
<InvokeMethod DisplayName="Delete File" mtbwt:BuildTrackingParticipant.Importance="None" ... />
Upvotes: 4