3. Hello world - build.sbt
name := "hello-play"!
!
version := "1.0-SNAPSHOT"!
!
libraryDependencies ++= Seq(!
jdbc,!
anorm,!
cache!
)
!
!
play.Project.playScalaSettings!
#DV13PlayTricks
@elmanu
4. Hello world - plugins.sbt
// Comment to get more information during initialization!
logLevel := Level.Warn!
!
// The Typesafe repository !
resolvers += "Typesafe repository" at "http://
repo.typesafe.com/typesafe/releases/"!
!
// Use the Play sbt plugin for Play projects!
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")!
#DV13PlayTricks
@elmanu
5. First things first: Scalariform
!
Code indentation is good for your health
#DV13PlayTricks
@elmanu
6. Scalariform! - plugins.sbt
// Comment to get more information during initialization!
logLevel := Level.Warn!
!
// The Typesafe repository !
resolvers += "Typesafe repository" at "http://
repo.typesafe.com/typesafe/releases/"!
!
// Use the Play sbt plugin for Play projects!
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")!
!
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.0")!
#DV13PlayTricks
@elmanu
11. Scalastyle! - plugins.sbt
// Comment to get more information during initialization!
logLevel := Level.Warn!
!
// The Typesafe repository !
resolvers += "Typesafe repository" at "http://
repo.typesafe.com/typesafe/releases/"!
!
// Use the Play sbt plugin for Play projects!
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")!
!
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.0")!
!
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" %
"0.3.2")
#DV13PlayTricks
@elmanu
28. Snapshot dependencies - workarounds
• Don’t use snapshot dependencies
• Convince library authors to make releases
• Use a cache, e.g. Squid
•
OS X: http://squidman.net/squidman
-‐Dhttp.proxyHost=localhost
-‐Dhttp.proxyPort=8090
#DV13PlayTricks
@elmanu
31. Play Auto Refresh - plugins.sbt
// Comment to get more information during initialization!
logLevel := Level.Warn!
!
// The Typesafe repository !
resolvers += "Typesafe repository" at "http://repo.typesafe.com/
typesafe/releases/"!
!
// Use the Play sbt plugin for Play projects!
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")!
!
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.0")!
!
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.3.2")!
!
addSbtPlugin("com.jamesward" %% "play-auto-refresh" % "0.0.7")
#DV13PlayTricks
@elmanu
32. Play Auto Refresh - build.sbt
name := "hello-play"!
!
version := "1.0-SNAPSHOT"!
!
libraryDependencies ++= Seq(!
jdbc,!
anorm,!
cache!
)
!
!
play.Project.playScalaSettings!
!
scalariformSettings!
!
org.scalastyle.sbt.ScalastylePlugin.Settings!
!
com.jamesward.play.BrowserNotifierPlugin.livereload
#DV13PlayTricks
@elmanu