-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.sbt
135 lines (104 loc) · 5.12 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
homepage := Some(url("https://github.com/miguno/akka-mock-scheduler"))
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html"))
organization := "com.miguno.akka"
name := "akka-mock-scheduler"
resolvers ++= Seq(
"typesafe-repository" at "http://repo.typesafe.com/typesafe/releases/"
)
// -------------------------------------------------------------------------------------------------------------------
// Variables
// -------------------------------------------------------------------------------------------------------------------
val akkaVersion = "2.5.23"
val javaVersion = "1.8"
val mainScalaVersion = "2.13.0"
// -------------------------------------------------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------------------------------------------------
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
"org.mockito" % "mockito-all" % "1.10.19" % "test"
)
// ---------------------------------------------------------------------------------------------------------------------
// Compiler settings
// ---------------------------------------------------------------------------------------------------------------------
crossScalaVersions := Seq(mainScalaVersion, "2.11.12", "2.12.8")
scalaVersion := mainScalaVersion
javacOptions in Compile ++= Seq(
"-source", javaVersion,
"-target", javaVersion,
"-Xlint:unchecked",
"-Xlint:deprecation")
scalacOptions ++= Seq(
"-target:jvm-" + javaVersion,
"-encoding", "UTF-8"
)
scalacOptions in Compile ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xlint", // Enable recommended additional warnings.
"-Ywarn-dead-code",
"-Ywarn-value-discard" // Warn when non-Unit expression results are unused.
) ++ (if (!scalaVersion.value.startsWith("2.13")) Seq(
"-Ywarn-adapted-args" // Warn if an argument list is modified to match the receiver.
) else Seq())
scalacOptions in Test ~= { (options: Seq[String]) =>
options.filterNot(_ == "-Ywarn-value-discard").filterNot(_ == "-Ywarn-dead-code" /* to fix warnings due to Mockito */)
}
// ---------------------------------------------------------------------------------------------------------------------
// Sonatype settings
// ---------------------------------------------------------------------------------------------------------------------
// https://github.com/jodersky/sbt-gpg
//
// Note: As of v2.0.0 this is also supported by https://github.com/sbt/sbt-pgp.
// See https://github.com/sbt/sbt-pgp/issues/125.
credentials += Credentials(
"GnuPG Key ID",
"gpg",
"5724DC6AAEC6D526992C234D07D42B2CB4799D71", // key identifier
"ignored" // this field is ignored; passwords are supplied by pinentry
)
sonatypeProfileName := "com.miguno"
publishMavenStyle := true
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
pomExtra := (
<scm>
<connection>scm:git:[email protected]:miguno/akka-mock-scheduler.git</connection>
<developerConnection>scm:git:[email protected]:miguno/akka-mock-scheduler.git</developerConnection>
<url>[email protected]:miguno/akka-mock-scheduler.git</url>
</scm>
<developers>
<developer>
<id>miguno</id>
<name>Michael G. Noll</name>
<url>http://www.michael-noll.com/</url>
</developer>
</developers>)
// ---------------------------------------------------------------------------------------------------------------------
// Testing settings
// ---------------------------------------------------------------------------------------------------------------------
// Write test results to file in JUnit XML format
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/test-reports/junitxml")
// Write test results to console.
//
// Tip: If you need to troubleshoot test runs, it helps to use the following reporting setup for ScalaTest.
// Notably these suggested settings will ensure that all test output is written sequentially so that it is easier
// to understand sequences of events, particularly cause and effect.
// (cf. http://www.scalatest.org/user_guide/using_the_runner, section "Configuring reporters")
//
// testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oUDT", "-eUDT")
//
// // This variant also disables ANSI color output in the terminal, which is helpful if you want to capture the
// // test output to file and then run grep/awk/sed/etc. on it.
// testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oWUDT", "-eWUDT")
//
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-o")