Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT: external config file with values accessible in build.sbt

Tags:

scala

sbt

I have an sbt project of standard structure. I'd like to have file, which I could separate from my build and to specify there values for use in Build.scala or build.sbt (to omit spoiling repository with local configurations).

It may be plain .properties format or scala file, or typesafe config, or any other (common .sbt practice is most welcomed of course):

prop1=value1
prop2=42
.......

Is there common practice for this so values are accessible in sbt build files? I want to pass them as test arguments to keep off of build files themselves.

like image 667
dmitry Avatar asked Apr 09 '14 16:04

dmitry


Video Answer


1 Answers

I had a similar problem. I created a github repository with the solution:

https://github.com/darkocerdic/sbt-config

Create a new file at project/resources/local.properties and add new values for values already in default.properties file.

local.properties file is in .gitignore so it will not propagate outside your local setup.

Look at build.sbt for example usage of defined properties.

like image 104
Darko Cerdic Avatar answered Oct 17 '22 14:10

Darko Cerdic