forked from carueda/tscfg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
64 lines (52 loc) · 1.99 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
lazy val tscfgVersion = setVersion("0.9.5")
organization := "com.github.carueda"
name := "tscfg"
version := tscfgVersion
scalaVersion := "2.12.2"
crossScalaVersions := Seq("2.12.2")
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.3.3",
"org.specs2" %% "specs2-core" % "4.0.2" % "test",
"org.json4s" %% "json4s-native" % "3.5.0",
"com.google.code.gson" % "gson" % "2.8.0"
)
scalacOptions in Test ++= Seq("-Yrangepos") // per specs2-core
mainClass in assembly := Some("tscfg.Main")
assemblyJarName in assembly := s"tscfg-$tscfgVersion.jar"
coverageExcludedPackages := "tscfg.example.*;tscfg.Main"
coverageMinimum := 80
coverageFailOnMinimum := false
coverageHighlighting := { scalaBinaryVersion.value == "2.11" }
lazy val genCode = taskKey[Unit]("Generate classes for tests")
fullRunTask(genCode, Compile, "tscfg.gen4tests")
fork in genCode := true
(testOnly in Test) <<= (testOnly in Test) dependsOn genCode
(test in Test) <<= (test in Test) dependsOn genCode
publishMavenStyle := true
publishArtifact in Test := false
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")
}
pomIncludeRepository := { _ => false }
homepage := Some(url("https://github.com/carueda/tscfg"))
licenses := Seq("Apache 2.0" -> url("http://www.opensource.org/licenses/Apache-2.0"))
scmInfo := Some(ScmInfo(url("http://github.com/carueda/tscfg"), "scm:[email protected]:carueda/tscfg.git"))
pomExtra :=
<developers>
<developer>
<id>carueda</id>
<name>Carlos Rueda</name>
<url>http://carueda.info</url>
</developer>
</developers>;
sonatypeProfileName := "com.github.carueda"
def setVersion(version: String): String = {
println(s"setting version $version")
IO.write(file("src/main/resources/application.conf"),
s"tscfg.version = $version\n")
version
}