-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sbt 0.13 #15
Comments
I vote for this too. I had to switch to 0.13 because of scala macros paradise plugin. |
Because of popular demand I took a quick look into it. It is quite hard to get this working properly. The problem with sbt-twirl is its version complexity. Since sbt 0.13 is now on Scala 2.10 it might be easier, but the basic problem is that sbt-twirl has a) an sbt plugin b) a library, Long story short: there are some ongoing considerations about the future of twirl so most likely there will be some solution eventually but unfortunately in the short-term we have no capacity to solve this issue. |
+1 |
I had to update to SBT 0.13 and run into the same problem. So i've made a quick-oneHour-hard-fix for sbt 0.13 + scala 2.10.2, suits as a temporary solution for projects highly dependent on Twirl - https://github.com/4lex1v/twirl. |
@4lex1v cool. Did you backport changes from the play project manually? |
@jrudolph Yes, but i took only critical parts, to make Twirl work |
@jrudolph So in other words, if I was going to need a templating engine real soon(tm) that I could rely on being maintained for the foreseeable future, look somewhere else? I realize that might be a difficult (or even loaded) question, but I'd love to hear a little bit more about the "ongoing considerations about the future of twirl". I don't mind having a somewhat moving target (hey, I usually build against the spray nightlies) but if it might get abandoned, I should probably look at something else :) |
Njal, |
+1 for resolving this issue... I managed to use twirl without "downgrading" my sbt 0.13 project creating another artifact responsible just for templating in sbt 0.12 and adding it as a depency in the main project. But is a few extra commands of sbt (publish and reload original) every time. Anyway, any change now that typesafe and spray are joined? |
+1 |
I'm tempted to give another +1 since this would be really helpful, but I also understand the scope of the problem. So, instead I'll ask: is there anything we can do as part of the community to help move this forward? Would it be worth continuing the work @4lex1v began adding in the latest Play updates and submitting a PR? I suspect that doesn't address some of the other issues @jrudolph described. |
Also of interest: does the akka acquisition of spray and that play will be
|
https://github.com/playframework/twirl From the spray-users mailing list, this is the repo to keep an eye on. I don't know how it affects this bug, but it's relevant. |
@dkowis Thanks for the pointer -- I hadn't yet looked at Twirl (though, unbeknownst to me, others in our org had already started using it) when the announcement of Spray joining Typesafe was made, so that point completely passed me by without my noticing it. For those of you wanting to see where this was mentioned, it was in @sirthias' long response to numerous questions (https://groups.google.com/d/msg/spray-user/IEVLn2ixAMQ/jSI5mA7VwFMJ), the specific quote being:
Just wanted to save anyone else the trouble of tracking this down. ;~) I guess I'll be taking my questions to the Play mailing list, next! |
Btw, for anyone else interested in this issue, I did finally post something on the Play mailing list: https://groups.google.com/forum/#!topic/play-framework/YXQk72btIXM Please chime in if you have the time and anything to add, even if it's just supporting the desire to get some kind of input on where things stand. Though it's not a major roadblock, this is currently holding up some small part of our work as we try to figure out the right way to move forward given the indefinite status of this. Not that I'm suggesting it's anyone's responsibility to solve this problem for us. But I am hoping for some input from either the Spray or Play teams on how the community should approach usage of this library. |
Sadly, cannot use SBT 0.13.x, because sbt-twirl only supports 0.12.x! spray/twirl#15 Add README, Travis.
+1 |
Thanks @4lex1v. With one tweak (https://github.com/4lex1v/twirl/pull/1) your fork worked great for me. I hope we get to see an official release soon. |
+1 |
2 similar comments
+1 |
+1 |
Jesus, now every moron will spam every subscriber with useless "+1" comment. |
@CPPExpert |
No, I'm not the same. The bug is 5 months old. It's been noticed by maintainers. There is temporary solution provided by other user. All I want to know is when its status changes to "Closed", not when another dude is compelled to make useless comment. So STFU. |
+1. If the kinda-sorta working 0.13.0 code is already there, it would be nice if it could be put somewhere people like me could depend upon =) |
@4lex1v, would you contribute your branch and sign the typesafe CLA? I would then make an attempt to release a version for 0.13 even if this would be only transitory. |
You can sign the CLA here: http://typesafe.com/contribute/cla/ |
@jrudolph of course, not a problem |
Thanks, cool. |
I incorporated recent changes from play into a new version. Many thanks @4lex1v for doing the main part of the merge! 🍰 I published a new You'll have to add this to resolvers += Classpaths.sbtPluginSnapshots
addSbtPlugin("io.spray" % "sbt-twirl" % "0.7.0-SNAPSHOT") The version is built from this branch: https://github.com/spray/twirl/commits/i/15/try-to-convert-to-sbt-0.13 |
worked for me, but i had to add resolvers += "Spray IO Release Repo" at "http://repo.spray.io" to my application that was depending upon my twirl compiled package otherwise the twirl-api could not be resolved, is this expected? |
Strange, |
I'll just chip in here and say it works for me out of the box. Thanks @jrudolph! Would be nice if it was a bit more flexible (e.g. working for both |
@jrudolph not sure, maybe i'm doing something wrong. My template project has this in project/twirl-plugin.sbt:
and this in the build.sbt:
that builds fine. My application references my template project, if i put a
i get an error on sbt load: "/home/cdamour/Code/scalaES/build.sbt:27: error: not found: value Twirl Twirl.settings" If i add the resolver then it fails at compile (because sbt.ResolveException: unresolved dependency: io.spray#twirl-api_2.10;0.7.0-SNAPSHOT: not found) |
@jrudolph I don't need to add resolvers:
but does not compile (find the templates), as from the documentation i have a test template in: /src/main/twirl/org/example/hello.scala.txt and calling as: org.example.txt.hello("blah", "blah") gives me: object example is not a member of package org |
@kinkadzs i found my compiled templates in a namespace location different than the docs. My template was in src/main/twirl/views/helper/bootstrap3/input.scala.html and i found the compiled class at views.html.helper.bootstrap3.input if that's how it's working, do you see your class at org.txt.example.hello ? |
@drdamour nope, i don't see it anywhere, and i cannot see it compiling during sbt compile either... it is like it doesn't find any templates.... after compiling i don't even have an org folder in /target... the only thing that i can see and that makes sense is target/scala-2.10/src_managed/main/generated-twirl-sources/ |
@kinkadzs Can you create a new issue (or post on the Spray ML) and post a project to reproduce this issue? |
@jrudolph Sure no problem. I will strip out the business logic and will post the project, Will do it today after work (in few hours). Btw thank you guys for helping. |
I works nice for me also, as for twirl logging during the compilation, it was removed from original compiler, but that's not hard to add some logging like it was done previously. |
@jrudolph @drdamour I created this new test project and everything works fine out of the box. https://github.com/kinkadzs/twirlsbt13 So in the previous project I had a dependency problem and now is fixed also. Everything works now. Anyway will leave that little project for a while as small example in case someone needs it. THANK YOU ! |
Thanks, @kinkadzs, I'll add it to the README. @4lex1v, ah, I found that logging quite useful, so maybe I'll add it back. |
@jrudolph I think it would be better to make logging as a build setting, cause in my case it was quite annoying, when you have many small scala.html files |
Released with new version 0.7.0. Thanks for all the help and input ! |
Fantastic work. Thanks!
|
it would be great, if sbt.013 would be supported :-)
The text was updated successfully, but these errors were encountered: