Skip to content

Instantly share code, notes, and snippets.

@salex89
Last active August 15, 2016 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salex89/6b2a0c3099de6e6360e8 to your computer and use it in GitHub Desktop.
Save salex89/6b2a0c3099de6e6360e8 to your computer and use it in GitHub Desktop.
Additional lines to Play's build.sbt
sources in (Compile, doc) := Seq.empty
publishArtifact in (Compile, packageDoc) := false
//Additional JPA configuration
PlayKeys.externalizeResources := false
mappings in Universal += file("conf/base.conf") -> "conf/base.conf"
mappings in Universal += file("conf/prod.conf") -> "conf/prod.conf"
///Use prod.conf as configuration
bashScriptExtraDefines += """if [ ! -f ${app_home}/../conf/prod.conf ]; then
echo "Configuration file: conf/prod.conf not found!"
exit 1
fi
addJava "-Dconfig.file=${app_home}/../conf/prod.conf""""
///Load external logger configuration when packaged. Originally uses the one from the JAR.
bashScriptExtraDefines +=
"""if [ -f ${app_home}/../conf/logger.xml ]; then
echo "Alternative logger being used"
addJava "-Dlogger.file=${app_home}/../conf/logger.xml"
fi"""
///Different conf files for test and running
javaOptions in Test += "-Dconfig.file=conf/application.test.conf"
javaOptions in IntegrationTest += "-Dconfig.file=conf/application.test.conf"
//jacoco settings
jacoco.settings
jacoco.excludes in jacoco.Config := Seq("views*", "*Routes*", "controllers*routes*", "controllers*Reverse*", "controllers*javascript*", "controller*ref*")
parallelExecution in jacoco.Config := false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment