forked from scapegoat-scala/scapegoat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
100 lines (81 loc) · 3.27 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 sbt.Keys._
name := "scalac-scapegoat-plugin"
organization := "com.sksamuel.scapegoat"
scalaVersion := "2.12.0"
crossScalaVersions := Seq("2.11.8", "2.12.0")
scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-encoding", "utf8", "-Xmax-classfile-name", "254")
publishMavenStyle := true
fullClasspath in console in Compile ++= (fullClasspath in Test).value // because that's where "PluginRunner" is
initialCommands in console := s"""
import com.sksamuel.scapegoat._
def check(code: String) = {
val runner = new PluginRunner { val inspections = ScapegoatConfig.inspections }
// Not sufficient for reuse, not sure why.
// runner.reporter.reset
val c = runner compileCodeSnippet code
val feedback = c.scapegoat.feedback
feedback.warnings map (x => "%-40s %s".format(x.text, x.snippet getOrElse "")) foreach println
feedback
}
"""
scalacOptions ++= Seq(
"-Xlint",
"-Ywarn-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Ywarn-numeric-widen"
//"-Ywarn-value-discard"
)
javacOptions ++= Seq("-source", "1.6", "-target", "1.6")
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
"org.scala-lang.modules" %% "scala-xml" % "1.0.5",
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "test",
"commons-io" % "commons-io" % "2.4" % "test",
"org.scalatest" %% "scalatest" % "3.0.0" % "test",
"org.mockito" % "mockito-all" % "1.9.5" % "test",
"joda-time" % "joda-time" % "2.3" % "test",
"org.joda" % "joda-convert" % "1.3.1" % "test",
"org.slf4j" % "slf4j-api" % "1.7.7" % "test"
)
sbtrelease.ReleasePlugin.autoImport.releasePublishArtifactsAction := PgpKeys.publishSigned.value
sbtrelease.ReleasePlugin.autoImport.releaseCrossBuild := true
publishTo <<= version {
(v: String) =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishMavenStyle := true
publishArtifact in Test := false
parallelExecution in Test := false
pomIncludeRepository := {
_ => false
}
pomExtra := {
<url>https://github.com/sksamuel/scapegoat</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:sksamuel/scapegoat.git</url>
<connection>scm:[email protected]:sksamuel/scapegoat.git</connection>
</scm>
<developers>
<developer>
<id>sksamuel</id>
<name>sksamuel</name>
<url>http://github.com/sksamuel</url>
</developer>
</developers>
}