为什么Play 2.2.3测试模板在子模块中未编译?

问题描述:

在我的多模块项目中的一个子模块中进行测试需要单独的测试模板,我将其放到test/views/。他们没有被编译。我该如何解决这个问题?为什么Play 2.2.3测试模板在子模块中未编译?

我已经看了发挥SBT插件源(2.2.x的分支),我发现的最接近的是 PlaySettings.scala, line 111

sourceGenerators in Compile <+= (state, unmanagedSourceDirectories in Compile, sourceManaged in Compile, templatesTypes, templatesImport) map ScalaTemplates, 

我想,我需要这样的加点设置到我的拥有build.sbt

UPDATE:问题解决了,请参阅下面

+0

如果你可以提供本地在github上的样本项目,克隆和测试,这将有助于。有太多的未知数,我害怕没有太多的帮助就给它一个测试。 – 2014-09-13 21:47:37

+0

@JacekLaskowski谢谢您的回复!这是一个示例项目。 https://github.com/stys/play-223-test-templates测试temaplates在主项目中无法编译,因此忘记子模块。运行'play test'来查看测试的输出。 – stys 2014-09-16 16:05:57

答案很接近。工作解决方案是将下面的行添加到项目的build.sbt

sourceGenerators in Test <+= (state, unmanagedSourceDirectories in Test, sourceManaged in Test, templatesTypes, templatesImport) map ScalaTemplates