【发布时间】:2011-06-07 11:23:55
【问题描述】:
我正在使用 TFS 2008 和团队构建来使用 ant 和 Microsoft Team Foundation Server 2010 Build Extensions 编译一些 Java 代码。我的经验是使用 Microsoft 堆栈,而 ant 对我来说有点陌生,我们有一个承包商,他对 Java / ant 世界了如指掌,但他以前从未使用过 TFS。
我创建了一个调用 ant build.xml 文件的 TFSbuild.proj。构建运行并编译代码,输出被复制到放置位置,所以这一切都很好。但是,当我检查构建日志时,我可以看到来自 Java 编译器的大量警告,但构建摘要显示 0 个错误,0 个警告。
我们的编码标准规定应解决所有编译器和静态代码分析警告,构建摘要是让开发人员知道他们需要查看代码的好方法。有没有办法让 ant 将错误/警告返回给团队构建,以便它可以用警告填充构建摘要?以下是我可以在日志中看到的一些警告示例。
[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.
【问题讨论】: