Scalariform settings in root build.sbt

This commit is contained in:
Enno Runne 2018-07-01 16:54:37 +02:00
parent 8cf5c7a546
commit 207f6e993b
2 changed files with 9 additions and 12 deletions

View File

@ -2,6 +2,7 @@
// update NEWS, update version in README.md, tag, then
// publishSigned.
// Release tags should follow: http://semver.org/
import scalariform.formatter.preferences._
enablePlugins(GitVersioning)
git.baseVersion := "1.3.0"
@ -22,7 +23,10 @@ val sonatype = new PublishToSonatype {
}
lazy val commonSettings: Seq[Setting[_]] = Def.settings(
unpublished
unpublished,
scalariformPreferences := scalariformPreferences.value
.setPreference(IndentSpaces, 4)
.setPreference(FirstArgumentOnNewline, Preserve)
)
lazy val root = (project in file("."))
@ -49,7 +53,10 @@ lazy val configLib = Project("config", file("config"))
publish := sys.error("use publishSigned instead of plain publish"),
publishLocal := sys.error("use publishLocalSigned instead of plain publishLocal"),
packageOptions in (Compile, packageBin) +=
Package.ManifestAttributes("Automatic-Module-Name" -> "typesafe.config" )
Package.ManifestAttributes("Automatic-Module-Name" -> "typesafe.config" ),
scalariformPreferences := scalariformPreferences.value
.setPreference(IndentSpaces, 4)
.setPreference(FirstArgumentOnNewline, Preserve)
)
.enablePlugins(SbtOsgi)
.dependsOn(testLib % "test->test")

View File

@ -1,13 +1,3 @@
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._
val formatPrefs = FormattingPreferences()
.setPreference(IndentSpaces, 4)
ScalariformKeys.preferences in Compile := formatPrefs
ScalariformKeys.preferences in Test := formatPrefs
fork in test := true
fork in Test := true
fork in run := true