scalaplayframeworkmill

How do I set up a PlayFramework project using the mill build tool, and without using SBT?


Here is how I currently set up a PlayFramework project for use with mill:

  1. Create a folder: /path/to/play-scala-seed-mill/ and cd into that folder.
  2. Create a build.sc file in this folder, according to the instructions in the official documentation for PlayFramework support.
  3. This is the part I don't like: to create the folder structure and add files for Play, I run sbt new playframework/play-scala-seed.g8 as per Play's official documentation. Is there a more mill-ish way to do this?
  4. Remove the SBT related code from the new folder created under /path/to/play-scala-seed-mill/ as a result of the above command.
  5. Create an idea project using the command mill mill.scalalib.GenIdea/idea.

How can I do this without using SBT?


Solution

  • To start a new Mill project without any SBT, I can think of these two possibilities:

    Start from scratch

    I usually start with an empty folder and add an empty build.sc.

    To setup the few needed folders and configurations is sometime faster than to remove all the stuff not needed in the Template.

    Create your own Giter8 Template

    If you start a lot of Projects - you can create your own Giter8 Template.

    This is straight forward and there is also a command-line tool that works without sbt.

    For example:

    g8 playframework/play-scala-seed.g8
    

    Creates the Play Template you already used.

    See here for more information: http://www.foundweekends.org/giter8/