0

I'm working through a tutorial for the Play 2 framework with Scala, and have encountered this error when attempting to compile:

[playProducts] $ compile
[trace] Stack trace suppressed: run last compile:managedSources for the full output.
[error] (compile:managedSources) java.io.FileNotFoundException:
/Users/peterbecich/scala/playProducts/app/views/tags/.#barcode.scala.html
(No such file or directory)

The managed sources list is not viewable.

[playProducts] $ show managedSources
[trace] Stack trace suppressed: run last compile:managedSources for the full output.
[error] (compile:managedSources) java.io.FileNotFoundException:
/Users/peterbecich/scala/playProducts/app/views/tags/.#barcode.scala.html (No such file or directory)

Unmanaged sources are viewable, and no temp files are listed.

[playProducts] $ show unmanagedSources
[info] ArrayBuffer(/Users/peterbecich/scala/playProducts/app/controllers/Application.scala, /Users/peterbecich/scala/playProducts/app/controllers/Barcodes.scala, /Users/peterbecich/scala/playProducts/app/controllers/Products.scala, /Users/peterbecich/scala/playProducts/app/models/Product.scala)

Is the solution similar to including something like this in build.sbt? This did not solve it, and obviously is not a solution for all temp files. Can you use regex in an SBT config file?

excludeFilter in managedSources := ".#barcode.scala.html"

I'm using Oracle JDK 8 on Mavericks. Should I downgrade to JDK 6 or 7? SBT is 0.13.5, Play is 2.2.3, and Scala is 2.10.3.

Here is the full compile error: http://pastebin.com/gGGmUE3f

Thanks for your feedback!

Peter Becich
  • 845
  • 1
  • 11
  • 25

2 Answers2

1

Unfortunately, there's nothing that can be done in Play 2.2.x... here's the code that finds all the templates:

  sourceDirectories.foreach { sourceDirectory =>
    (sourceDirectory ** "*.scala.*").get.collect(templateExt).foreach {

It doesn't give any opportunity to filter that :(

However, in Play 2.3, we've rewritten the SBT portion of the Template compiler (it's now called Twirl), and locating source files is now done properly (ie, uses standard SBT mechanisms), so you can:

excludeFilter in TwirlKeys.compileTemplates := ".#*"

Though this actually isn't even necessary, since the default exclude filter excludes all hidden files, which includes emacs files because they start with ..

James Roper
  • 12,340
  • 41
  • 44
0

Oddly, exiting Emacs fixed sbt compile.

I was using the Emacs plugin Ensime, if that matters at all.

sbt clean did not solve the issue, nor did removing all target directories, like here: https://stackoverflow.com/a/18045926/1007926

Community
  • 1
  • 1
Peter Becich
  • 845
  • 1
  • 11
  • 25