tuplejump / play-yeoman

Play + Yeoman integration sbt and play plugins
Apache License 2.0
237 stars 58 forks source link

SBT Load Error on adding play-yeoman to a project having incremental compilation with name hashing enabled #42

Closed diwa-zz closed 10 years ago

diwa-zz commented 10 years ago

Hello, Firstly, thanks for the great library that eases building SPAs with play backend.

On a project which had play-yeoman, I tried to enable the improved incremental compiler with name hashing that is available from SBT 0.13.2-M1. Unfortunately, i get an error on loading of the play project

I have created a skeleton play project to reproduce the issue at https://github.com/diwa/play-yeoman-incremental-compiler-error

➜  play-yeoman-incremental-compiler-error git:(master) play
[info] Loading project definition from /Users/xyz/code/error/play-yeoman-incremental-compiler-error/project
/Users/xyz/code/error/play-yeoman-incremental-compiler-error/build.sbt:6: error: value withNameHashing is not a member of sbt.inc.IncOptions
incOptions := incOptions.value.withNameHashing(true)
                               ^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

cc - @gkossakowski

gkossakowski commented 10 years ago

Hi!

I looked into this and the problem is with sbt-yeoman. It breaks sbt in some strange way. If I comment out enabling name hashing so I can load the project I get the following problem:

[play-yeoman-incremental-compiler-error] $ consoleProject
[info] Starting scala interpreter...
[info] 
<console>:5: error: type Imports is not a member of object sbt.ConsoleProject
  var value: sbt.ConsoleProject.Imports = _
                                ^
<console>:6: error: type Imports is not a member of object sbt.ConsoleProject
  def set(x: Any) = value = x.asInstanceOf[sbt.ConsoleProject.Imports]
                                                              ^
<console>:11: error: not found: value cpHelpers
       import currentState._, extracted._, cpHelpers._;

if I remove sbt-yeoman plugin I can start consoleProject without problem. Enabling name hashing works as well.

diwa-zz commented 10 years ago

This is probably a different/related issue. I tried running consoleProject in the sample project yo-demo and encountered the same problem there.

But that did not stop the project from running successfully.

gkossakowski commented 10 years ago

In both cases sbt seems to use outdated classpath and can't resolve types/members. Removing the plugin fixes both the problem with consoleProject and with enabling name hashing.

diwa-zz commented 10 years ago

@milliondreams - Can you help

milliondreams commented 10 years ago

@diwa

Can you tell what version of play and SBT are you using?

diwa-zz commented 10 years ago

I am using play 2.2.2 and sbt - 0.13.2-M3. This can be found in https://github.com/diwa/play-yeoman-incremental-compiler-error

diwa-zz commented 10 years ago

@milliondreams - bump

milliondreams commented 10 years ago

@diwa We haven't yet built play-yeoman against sbt 0.13.2-x and incremental compiler. We are currently getting it to work with 2.3 and should be able to take this up after that.

diwa-zz commented 10 years ago

Great...For 2.3, are you considering to rewrite this as a sbt-web plugin

milliondreams commented 10 years ago

@diwa Let us know if you still face this issue with 0.7.1-SNAPSHOT. Though we have not tried it yet... but i am hoping the new updates will fix this one!

diwa-zz commented 10 years ago

I can confirm that this works properly now.