forked from scalastyle/scalastyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
100 lines (69 loc) · 2.57 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import AssemblyKeys._
name := "scalastyle"
organization := "org.scalastyle"
scalaVersion := "2.10.5"
scalacOptions ++= Seq("-deprecation", "-feature")
crossScalaVersions := Seq("2.10.5", "2.11.6")
description := "Scalastyle style checker for Scala"
libraryDependencies ++= Seq(
"org.scalariform" %% "scalariform" % "0.1.7",
"com.typesafe" % "config" % "1.2.0",
"junit" % "junit" % "4.11" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test",
"com.google.guava" % "guava" % "17.0" % "test",
"org.scalatest" %% "scalatest" % "2.2.2" % "test")
fork in Test := true
javaOptions in Test += "-Dfile.encoding=UTF-8"
coverageHighlighting := {
if (scalaBinaryVersion.value == "2.10") false
else true
}
publishMavenStyle := true
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT")) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html"))
pomIncludeRepository := { _ => false }
pomExtra := (
<url>http://www.scalastyle.org</url>
<scm>
<url>scm:git:[email protected]:scalastyle/scalastyle.git</url>
<connection>scm:git:[email protected]:scalastyle/scalastyle.git</connection>
</scm>
<developers>
<developer>
<id>matthewfarwell</id>
<name>Matthew Farwell</name>
<url>http://www.farwell.co.uk</url>
</developer>
</developers>)
assemblySettings
artifact in (Compile, assembly) ~= { art =>
art.copy(`classifier` = Some("batch"))
}
addArtifact(artifact in (Compile, assembly), assembly)
mainClass in assembly := Some("org.scalastyle.Main")
buildInfoSettings
sourceGenerators in Compile <+= buildInfo
buildInfoKeys := Seq[BuildInfoKey](organization, name, version, scalaVersion, sbtVersion)
buildInfoPackage := "org.scalastyle"
seq(filterSettings: _*)
if (System.getProperty("scalastyle.publish-ivy-only") == "true") {
Seq()
} else {
Seq(aetherPublishBothSettings: _*)
}
aether.Aether.aetherLocalRepo := Path.userHome / "dev" / "repo"
EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Managed
releaseSettings
ReleaseKeys.crossBuild := true
val dynamicPublish = Def.taskDyn {
if (version.value.trim.endsWith("SNAPSHOT")) {
Def.task { publish.value }
} else {
Def.task { PgpKeys.publishSigned.value }
}
}
ReleaseKeys.publishArtifactsAction := dynamicPublish.value