I am using TFS 2008 and team build to compile some Java code using ant and the Microsoft Team Foundation Server 2010 Build Extensions. My experience is with the Microsoft stack and ant is a bit of an unknown for me, we have a contractor who knows all about the Java / ant world but he's never used TFS before.
I've created a TFSbuild.proj which calls an ant build.xml file. The build runs and compiles the code, the output is copied to the drop location, so all of that is good. However when I inspect the build log I can see lots of warnings from the Java compile开发者_JS百科r, but the build summary says 0 errors, 0 warnings.
Our coding standards dictate that all compiler and static code anlysis warnings should be addressed and the build summary is a great way to let developers know that they need to look at the code. Is there any way of getting ant to return the errors / warnings back to team build so that it can populate the build summary with the warnings? Below are some examples of the warnings I can see in the log.
[buildObjects] E:\Build\Sources\Project\custom\WEB-INF\config\Configuration\Audit Configuration.xml: warning: You are overring an object imported by init.xml with the same 'Audit Configuration' but with a different ID '#ID#Configuration:AuditConfiguration'.
[buildObjects] E:\Build\Sources\Project\custom\WEB-INF\config\AdminGroup\Manager Operations.xml: warning: It is a recommended best practice that the object 'Manage Operations' specify an ID '#ID#AdminGroup:Manage Operations'.
[buildObjects] E:\Build\Project\custom\WEB-INF\config\AdminRole\AdminRole-operations.xml: warning: ObjectRef to object 'IS Admin' cannot be resolved in the current project.
[buildObjects] E:\Build\Project\custom\WEB-INF\config\Configuration\SubProcess-addAccessManager.xml:153: warning: Unresolved reference to variable 'user'. Variable is assumed to be a task input variable.
The Build Extensions power tool should be parsing out errors and warnings and putting them into your build log already I think. Can you drop me a line (martinwo@microsoft.com) with your ant log output and I'll try and take a look? I'll edit this answer again once we've figured it out.
精彩评论