0
votes

I am using sbt for my scala project, i want to create build for different environment like local, development, stage and production. these build will have different property file, log4j file and token files. So to handle this i need different folders with files under src/main/resources like local, dev, stage and prod. Based on the build environment it should pick files from respective folders. Can you guide me to do this using sbt.

1
Read up on scala-sbt.org/0.13/docs/Scopes.html and pick an axis which you wanna use to define the different environments. I'd recommend different projects, akin to what scala.js does. - Reactormonk

1 Answers

0
votes

Instead of create different files use environment variables inside https://github.com/typesafehub/config , for instance:

akka {
  loglevel = "DEBUG"
  loglevel = ${?LOGLEVEL}
}

If LOGLEVEL is not set "DEBUG" is the default config. Anyway, if you want to include different files making jars you can use different configuration for the sbt-assembly plugging.