如果 test=true,我想从检测代码中排除 cobertura。
现在,我在顶部有所有必需的陈述:
require 'buildr/java/cobertura'
require 'buildr/scala'
然后每次构建运行我都会得到这个:
使用 cobertura 数据文件 C:/usr/git_workspaces/reports/cobertura.ser 检测类
这意味着我的生产代码中有 cobertura 仪器。
这是我构建的下一部分
compile.with CORE, SLF4J, LOG4J, WS_CLIENTS, JODA_TIME,
[omitted for brevity]
compile.options.other = %w(-encoding UTF-8)
cobertura.exclude '[omitted for brevity]'
resources.filter.using *RESOURCES_FILTER
test.using :junit
# need this because of forking. It does not appear to use the environmental variables defined above.
test.using :java_args => ["-XX:MaxPermSize=128M"]
test.with JUNIT, SCALATEST, MOCKITO, POWERMOCK, HAMCREST, SPRING.test
# Pakcage is below here but the code has already been instrumented...
compile.with 是实际发生编译的地方吗?所以我可以做一个 if 测试然后添加 cobertura ?