Creating a minimal SBT project

I already mentioned, that my application will use following:

  1. Play framework
  2. Compile time dependency injection
  3. SQL, migrations, scalikeJDBC
  4. ScalaJS
  5. Akka

There are ready-to use-template projects for these features. However, I decided to start with a minimalist approach, so that I can understand what is really going on under hood.

Minimalistic approach consists of a single file: build.sbt

There is an excellent post, which goes under hood of even such a simple setup: https://kubuszok.com/2018/relearn-your-sbt/. I recommend reading it.

Let’s import this SBTproject into IntelliJ:

Now, let’s run sbt compile from command line. SBT was looking for Scala and Java classes to compile in src/{main,test}/{scala,java} directories. There were none obviously. Still, some new files appeared.

We now have a new file project/build.properties. Let’s bumb the SBT version to the latest available according to¬†https://www.scala-sbt.org/download.html and add this file to GIT.

Let add all other file to GIT ignore list.

In next post, we will transform this module into a PlayFramework WEB module.

Leave a Reply

Your email address will not be published. Required fields are marked *