[英]SBT Coverage “exclude” used in Play application
I used the sbt-scoverage for our Play application. 我在我们的Play应用程序中使用了sbt-scoverage。
I used the following config to exclude both Reverse and Routes generated file. 我使用以下配置来排除反向和路由生成的文件。
coverageExcludedPackages := ";Reverse.;Routes.;"
However this can only exclude generated Reverse scala files and can't exclude Routes files. 但是,这只能排除生成的反向scala文件,并且不能排除路由文件。 Even I use the following script, it does the same
即使我使用以下脚本,它也会这样做
coverageExcludedPackages := ";Routes.*;"
Anyone knows what is the correct regex should be? 谁知道正确的正则表达式应该是什么?
作为@ socom1880答案的改进,这对我来说是通过将它添加到build.sbt
来build.sbt
coverageExcludedPackages := "<empty>;Reverse.*;router\\.*"
尝试
coverageExcludedPackages := "<empty>;router\\\\..*;"
Better to try the below configuration: 最好尝试以下配置:
coverageExcludedPackages := ".*Reverse.*;Routes.*"
This will definitely work. 这肯定会奏效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.