Work with templates in any directory. #69

Merged
merged 1 commit into from Apr 4, 2013
Jump to file or symbol
Failed to load files and symbols.
+11 −2
Diff settings

Always

Just for now

@@ -91,7 +91,13 @@ class TemplateCompilationUnitTest {
assertTrue("Creating a `TemplateCompilationUnit` should force the underlying project to automatically add the Scala nature.", project.hasScalaNature)
}
-
+
+ @Test
+ def views_in_non_standard_folder_work() {
+ val tFile = file("moreviews/more.scala.html")
+ val tu = TemplateCompilationUnit(tFile)
+ assertTrue(s"No errors expected ${tu.currentProblems.map(_.getMessage())}", tu.generatedSource.isSuccess)
+ }
}
/**
@@ -0,0 +1,3 @@
+@(message: String)
+
+<html><body>@message</body></html>
@@ -51,7 +51,7 @@ class PlayProject private (val scalaProject: ScalaProject) {
*
* @return the absolute location of the `/app/views` directory, below the project root
*/
- lazy val sourceDir = new File(scalaProject.underlying.getLocation().toString() + "/app/views")
+ lazy val sourceDir = scalaProject.underlying.getLocation().toFile()
}
object PlayProject {