I'm a huge fan of the PlayFramework, but I have limited experience with SBT / Scala. I've been trying to use Kotlin more, so I'm trying to get Kotlin Running on SBT / PlayFramework.
I've used Kotlin with the Gradle Build system, but that requires me to apply the Kotlin Gradle plugin. Not sure how to do the equivalent for SBT.
Here is your basic build.sbt for Play. How would I go about getting adding Kotlin?
name := """KotlinTestServer"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache,
javaWs
)
I'd have to add "org.jetbrains.kotlin" % "kotlin-stdlib" % "0.10.195"
as a library dependency, but what else?
You can run the created application and view the result in the default browser http://localhost:9000. To run a Play application: Create a new Run Configuration – From the main menu, select Run -> Edit Configurations. Click on the + to add a new configuration.
Generate configuration To debug, start your application with activator -jvm-debug 9999 run and in Eclipse right-click on the project and select Debug As, Debug Configurations. In the Debug Configurations dialog, right-click on Remote Java Application and select New. Change Port to 9999 and click Apply.
sbt : The sbt settings that describe building your application. /conf : Configuration files for your application. /project : Further build description information. /public : Where static, public assets for your application are stored. /test : Where your application's test code will be stored.
8 months late, but there is now: Github kotlin-plugin
addSbtPlugin("com.hanhuy.sbt" % "kotlin-plugin" % "0.5")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With