Search code examples
scalaintellij-ideaplayframeworksbttypesafe-activator

Finding a version of the Play framework compatible with a specific Scala version


I have to build a web app with the Play framework but am constrained to using Scala 2.10.4 and SBT 0.13.5. Is there a way I can find which Play framework or Activator versions are compatible with this set up? In general, how does one tell which Scala and Play versions are compatible?

Additionally, is there a way to tell IntelliJ Idea to run against this specific version?


Solution

  • So I was just playing around with the different versions today. I think the best way to to look at their upgrade guides.

    Migration guide to Play2.3

    Migration guide to Play2.4

    If you check out those pages you will see in the 2.3 migration guide:

    Play uses sbt 0.13.5. If you’re updating an existing project, change your project/build.properties file to:

    On the 2.4 migration guide they mention

    Play 2.4 now requires a minimum of sbt 0.13.8. Update your project/build.properties so that it reads:

    I usually browse mvnrepository to see visually checkout dependencies for libraries and see which scala verison they are built for. This approach is not perfect but just an idea. Here are play options for scala2.10 Its important to look at the upgrade guides as well because on 2.4 release there are some notes about 2.10

    In your build files you can specify scalaVersion as well as SBT version which if you then open your project in Intellij it should conform with.

    SBT can go in project/build.properties and you can enter

    sbt.version=0.13.5
    

    Scala version can go in your build.sbt like this

    scalaVersion := "2.10.5"
    

    In terms of Activator templates I don't know of a good way to check those. When I search for them sometimes the description contains information like using library at version x.y.z but sometimes I need to click on that template and go check out the github link to determine if the verison of this template will meet specific criteria. With the criteria you mentioned above is seems like 2.3 is the latest version of the framework you can use. Most libraries that work with 2.4 should have a version for 2.3 as well unless they are very new. 2.4 had some breaking changes so this might not always be true but hope that helps.