-
Notifications
You must be signed in to change notification settings - Fork 63
/
build.sbt
83 lines (73 loc) · 2.55 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
val projectName = "sbt-scalariform"
val sbtScalariform = Project(projectName, file("."))
sbtPlugin := true
organization := "org.scalariform"
name := projectName
sonatypeProfileName := organization.value
version in ThisBuild := "1.8.3"
licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")))
homepage := scmInfo.value map (_.browseUrl)
scmInfo :=
Some(
ScmInfo(url("https://github.com/sbt/sbt-scalariform"),
"scm:git:[email protected]:sbt/sbt-scalariform.git")
)
developers := List(
Developer(
"hseeberger", "Heiko Seeberger", "mail at heikoseeberger de",
url("http://blog.heikoseeberger.name/")
),
Developer(
"daniel-trinh", "Daniel Trinh", "daniel s trinh at gmail com",
url("http://danieltrinh.com")
)
)
crossSbtVersions := Vector("0.13.18", "1.2.8")
scalacOptions ++= List(
"-unchecked",
"-deprecation",
"-Xlint",
"-language:_",
"-encoding", "UTF-8"
) ++ (if (scalaVersion.value startsWith "2.10.") List("-target:jvm-1.6") else List.empty)
libraryDependencies += "org.scalariform" %% "scalariform" % "0.2.10"
com.typesafe.sbt.SbtScalariform.ScalariformKeys.preferences := {
import scalariform.formatter.preferences._
FormattingPreferences()
.setPreference(AlignArguments, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(AlignSingleLineCaseStatements.MaxArrowIndent, 20)
.setPreference(DanglingCloseParenthesis, Force)
.setPreference(CompactControlReadability, true)
.setPreference(SpacesAroundMultiImports, false)
}
// preserve formatting of sbt-scripted test files
excludeFilter in scalariformFormat := "unformatted.scala" || "formatted.scala"
enablePlugins(SbtPlugin)
scriptedLaunchOpts := {
val sbtAssemblyVersion = "0.14.5"
scriptedLaunchOpts.value ++ Seq(
"-Xmx1024M",
s"-Dsbt-assembly.version=${sbtAssemblyVersion}",
s"-Dsbt-scalariform.version=${version.value}"
)
}
scriptedBufferLog := false
publishMavenStyle := true
publishArtifact in Test := false
publishArtifact in (Compile, packageDoc) := true
publishArtifact in (Compile, packageSrc) := true
pomIncludeRepository := { _ => false }
buildInfoKeys := Seq[BuildInfoKey](version)
buildInfoPackage := projectName
publishTo := getPublishToRepo.value
credentials ++= {
val creds = Path.userHome / ".m2" / "credentials"
if (creds.exists) Seq(Credentials(creds)) else Nil
}
def getPublishToRepo = Def.setting {
if (isSnapshot.value)
Some(Opts.resolver.sonatypeSnapshots)
else
Some(Opts.resolver.sonatypeStaging)
}