SBT Coverage “exclude” used in Play application

夙愿已清 提交于 2019-12-10 10:24:00

问题


I used the sbt-scoverage for our Play application.

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. Even I use the following script, it does the same

coverageExcludedPackages := ";Routes.*;"

Anyone knows what is the correct regex should be?


回答1:


As an improvement to @socom1880's answer, this worked for me by adding it to build.sbt

coverageExcludedPackages := "<empty>;Reverse.*;router\\.*"



回答2:


Try

coverageExcludedPackages := "<empty>;router\\..*;"




回答3:


Better to try the below configuration:

coverageExcludedPackages := ".*Reverse.*;Routes.*"

This will definitely work.



来源:https://stackoverflow.com/questions/32331183/sbt-coverage-exclude-used-in-play-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!