Hi all!
After migration from play 2.4
to 2.5
, we faced with deprecation warnings inside twirl templates: ...web/templates/index.scala.html:2: method get in object Messages is deprecated: see corresponding Javadoc for more information.
[warn] <a href="@routes.Auth.login()">@Messages.get("login") </a>
[warn] 1501 warnings found
-deprecation
flag inside scalaOptions
works fine for classes, but looks like it doesn't affect *.scala.html
files.
Twirl wiki says about withtwirlRecompilationLogger
TaskKey
(twirlRecompilationLogger = TaskKey[(File, File) => Unit]
), but play 2.5
doesn't contain it (play.twirl.sbt.Import.TwirlKeys._
).
Any ideas how to suppress deprecation
warnings inside templates?
Thanks
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/e159865c-d5e1-4785-aba3-7bd466f75354%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/modules/web/app/views/web/index.scala.html b/modules/web/app/views/web/index.scala.html
index 43773e5..1e81429 100644
--- a/modules/web/app/views/web/index.scala.html
+++ b/modules/web/app/views/web/index.scala.html
@@ -1,6 +1,7 @@
@(message: String, computers: List[Computer], configThisFile: String)(implicit messages: Messages)
@import controllers.web.routes
+@import play.i18n.{Messages => MessagesDep}
@theModals = {
<div class="modal fade" id="myWebModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
@@ -12,6 +13,7 @@
</div>
<div class="modal-body">
<p>@Messages("modal.text")</p>
+ <p>@MessagesDep.get("modal.text")</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@Messages("modal.close")</button>
@@ -59,4 +61,4 @@
</tr>
}
</table>
-}
\ No newline at end of file
+}
/play-multidomain-seed/modules/web/app/views/web/index.scala.html:17: method get in object Messages is deprecated: see corresponding Javadoc for more information.
[warn] <p>@MessagesDep.get("modal.text")</p>
scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked", "-language:reflectiveCalls", "-language:postfixOps", "-language:implicitConversions"),
You need to use scalacOptions:
On Wed, Jun 21, 2017 at 3:13 AM, Vitalii Stein <unkno...@gmail.com> wrote:
Hi all!
After migration from play
2.4
to2.5
, we faced with deprecation warnings inside twirl templates:...web/templates/index.scala.html:2: method get in object Messages is deprecated: see corresponding Javadoc for more information. [warn] <a href="@routes.Auth.login()">@Messages.get("login") </a> [warn] 1501 warnings found
-deprecation
flag insidescalaOptions
works fine for classes, but looks like it doesn't affect*.scala.html
files.
Twirl wiki says about
withtwirlRecompilationLogger
TaskKey
(twirlRecompilationLogger = TaskKey[(File, File) => Unit]
), butplay 2.5
doesn't contain it (play.twirl.sbt.Import.TwirlKeys._
).
Any ideas how to suppress
deprecation
warnings inside templates?
Thanks
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/b449ee34-a27a-48d3-ba6c-5daf6f797133%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/b449ee34-a27a-48d3-ba6c-5daf6f797133%40googlegroups.com.