Skip to content

Commit

Permalink
Scalariform settings in root build.sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru committed Jul 1, 2018
1 parent 8cf5c7a commit 207f6e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
11 changes: 9 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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("."))
Expand All @@ -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")
Expand Down
10 changes: 0 additions & 10 deletions config/build.sbt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 207f6e9

Please sign in to comment.