Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What files to check into source control for sbt/activator project?

When using gradle/Java I know what to check in (gradle wrapper/gradle shell script) and what not to check in (.gradle) and instead have in my .gitignore.

What should one check in for a activator/sbt projects for Scala?

I see the following files in a recent project I created:

  • activator (shell script)
  • activator.bat
  • activator-launch-1.2.12.jar
  • build.sbt
  • target (tree of files)
  • project (tree of files)

I don't see any useful guides for this via a google search on on the sbt reference manual.

Ok, this might help a bit. I decided to create a new project (using activator). I did template = minimal-scala and project name minimal-scala. It created the following files:

hostname:minimal-scala username$ find . -type f
./.gitignore
./activator
./activator-launch-1.2.12.jar
./activator.bat
./build.sbt
./LICENSE
./project/build.properties
./src/main/scala/com/example/Hello.scala
./src/test/scala/HelloSpec.scala

hostname:minimal-scala username$ cat .gitignore 
/RUNNING_PID
/logs/
/project/*-shim.sbt
/project/project/
/project/target/
/target/

I'm guessing this means, I should checkin the .gitignore as is, the src tree, build.sbt, project (everything but what was noted in .gitignore), activator jar and launching sh and bat files.

like image 813
Andrew Avatar asked Jan 06 '15 04:01

Andrew


1 Answers

IMO, you should check in only those files which are absolutely necessary to build a project.

Build.sbt - necessary. You can't build the project without it.

project - project contains plugins and Build.scala files which are necessary. Check those in. It usualy contains the target folder which should not be checked in.

I use sbt for everything and eclipse as IDE. Others might use activator but it is not necessary. This is a personal preference which should not be part of your build.

It comes down to this basically, how much a new person needs to download before being productive. You check in activator which he might not even need.

like image 64
mohit Avatar answered Sep 30 '22 02:09

mohit