Update project template

This commit is contained in:
Sarah Gerweck 2017-12-19 22:08:05 -08:00
parent f22f12e3ae
commit 5450df936e
No known key found for this signature in database
GPG Key ID: AFCB37207DB3F226
2 changed files with 14 additions and 4 deletions

View File

@ -14,14 +14,15 @@ trait BasicSettings extends ProjectSettings { st: SettingTemplate =>
lazy val optimize = boolFlag("OPTIMIZE") orElse boolFlag("OPTIMISE") getOrElse defaultOptimize lazy val optimize = boolFlag("OPTIMIZE") orElse boolFlag("OPTIMISE") getOrElse defaultOptimize
lazy val optimizeGlobal = boolFlag("OPTIMIZE_GLOBAL") getOrElse defaultOptimizeGlobal lazy val optimizeGlobal = boolFlag("OPTIMIZE_GLOBAL") getOrElse defaultOptimizeGlobal
lazy val optimizeWarn = boolFlag("OPTIMIZE_WARNINGS") getOrElse false lazy val optimizeWarn = boolFlag("OPTIMIZE_WARNINGS") getOrElse false
lazy val disableAsserts = boolFlag("DISABLE_ASSERTIONS") getOrElse defaultDisableAssertions
lazy val noFatalWarn = boolFlag("NO_FATAL_WARNINGS") getOrElse false lazy val noFatalWarn = boolFlag("NO_FATAL_WARNINGS") getOrElse false
lazy val deprecation = boolFlag("NO_DEPRECATION") map (!_) getOrElse true lazy val deprecation = boolFlag("NO_DEPRECATION") map (!_) getOrElse true
lazy val inlineWarn = boolFlag("INLINE_WARNINGS") getOrElse false lazy val inlineWarn = boolFlag("INLINE_WARNINGS") getOrElse defaultWarnInline
lazy val debug = boolFlag("DEBUGGER") getOrElse false lazy val debug = boolFlag("DEBUGGER") getOrElse false
lazy val debugPort = intFlag("DEBUGGER_PORT", 5050) lazy val debugPort = intFlag("DEBUGGER_PORT", 5050)
lazy val debugSuspend = boolFlag("DEBUGGER_SUSPEND") getOrElse true lazy val debugSuspend = boolFlag("DEBUGGER_SUSPEND") getOrElse true
lazy val unusedWarn = boolFlag("UNUSED_WARNINGS") getOrElse false lazy val unusedWarn = boolFlag("UNUSED_WARNINGS") getOrElse defaultWarnUnused
lazy val importWarn = boolFlag("IMPORT_WARNINGS") getOrElse false lazy val importWarn = boolFlag("IMPORT_WARNINGS") getOrElse defaultWarnImport
lazy val findbugsHtml = boolFlag("FINDBUGS_HTML") getOrElse !isJenkins lazy val findbugsHtml = boolFlag("FINDBUGS_HTML") getOrElse !isJenkins
lazy val newBackend = boolFlag("NEW_BCODE_BACKEND") getOrElse defaultNewBackend lazy val newBackend = boolFlag("NEW_BCODE_BACKEND") getOrElse defaultNewBackend
lazy val noBuildDocs = boolFlag("NO_SBT_DOCS").getOrElse(false) && !isJenkins lazy val noBuildDocs = boolFlag("NO_SBT_DOCS").getOrElse(false) && !isJenkins
@ -89,6 +90,9 @@ trait BasicSettings extends ProjectSettings { st: SettingTemplate =>
if (sv.backend == SupportsNewBackend && newBackend) { if (sv.backend == SupportsNewBackend && newBackend) {
options :+= "-Ybackend:GenBCode" options :+= "-Ybackend:GenBCode"
} }
if (disableAsserts) {
options :+= "-Xdisable-assertions"
}
options options
} }
@ -145,7 +149,8 @@ trait BasicSettings extends ProjectSettings { st: SettingTemplate =>
def addScalacOptions(optim: Boolean = optimize) = new Def.SettingList(Seq( def addScalacOptions(optim: Boolean = optimize) = new Def.SettingList(Seq(
basicScalacOptions, basicScalacOptions,
optimizationScalacOptions(optim) optimizationScalacOptions(optim),
scalacOptions ++= extraScalacOptions
)) ))
def addJavacOptions() = Def.derive { def addJavacOptions() = Def.derive {

View File

@ -19,6 +19,11 @@ trait SettingTemplate {
val defaultOptimize: Boolean = true val defaultOptimize: Boolean = true
val defaultOptimizeGlobal: Boolean = false val defaultOptimizeGlobal: Boolean = false
val inlinePatterns: Seq[String] = Seq("!akka.**","!slick.**") val inlinePatterns: Seq[String] = Seq("!akka.**","!slick.**")
val defaultDisableAssertions: Boolean = false
val defaultWarnUnused: Boolean = false
val defaultWarnImport: Boolean = false
val defaultWarnInline: Boolean = false
val extraScalacOptions: Seq[String] = Seq.empty
val autoAddCompileOptions: Boolean = true val autoAddCompileOptions: Boolean = true
val parallelBuild: Boolean = true val parallelBuild: Boolean = true