-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
97 lines (76 loc) · 3.08 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
import sbt.IO
import DicomSourceGenerators._
name := "dicom-streams"
version := "0.10-SNAPSHOT"
organization := "se.nimsa"
scalaVersion := "2.12.8"
scalacOptions := Seq("-encoding", "UTF-8", "-Xlint", "-deprecation", "-unchecked", "-feature", "-target:jvm-1.8")
scalacOptions in(Compile, doc) ++= Seq(
"-no-link-warnings" // Suppresses problems with Scaladoc @throws links
)
// build info settings
enablePlugins(BuildInfoPlugin)
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
buildInfoPackage := "se.nimsa.dicom"
// repos
resolvers ++= Seq(
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/")
// deps
libraryDependencies ++= {
val akkaVersion = "2.5.21"
Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.1.1",
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"org.slf4j" % "slf4j-simple" % "1.7.25",
"org.scalatest" %% "scalatest" % "3.0.5" % "test",
"com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion % "test"
)
}
updateOptions := updateOptions.value.withCachedResolution(true)
// specify that there are managed sources and their destinations
sourceGenerators in Compile += Def.task {
val tagFile = (sourceManaged in Compile).value / "sbt-dicomdata" / "Tag.scala"
val uidFile = (sourceManaged in Compile).value / "sbt-dicomdata" / "UID.scala"
val tagToVRFile = (sourceManaged in Compile).value / "sbt-dicomdata" / "TagToVR.scala"
val tagToVMFile = (sourceManaged in Compile).value / "sbt-dicomdata" / "TagToVM.scala"
val tagToKeywordFile = (sourceManaged in Compile).value / "sbt-dicomdata" / "TagToKeyword.scala"
IO.write(tagFile, generateTag())
IO.write(uidFile, generateUID())
IO.write(tagToKeywordFile, generateTagToKeyword())
IO.write(tagToVRFile, generateTagToVR())
IO.write(tagToVMFile, generateTagToVM())
Seq(tagFile, uidFile, tagToKeywordFile, tagToVRFile, tagToVMFile)
}.taskValue
// include managed sources among other sources when publishing
mappings in (Compile, packageSrc) ++= {
val base = (sourceManaged in Compile).value
val files = (managedSources in Compile).value
files.map { f => (f, f.relativeTo(base).get.getPath) }
}
// for automatic license stub generation
organizationName := "Lars Edenbrandt"
startYear := Some(2018)
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt"))
// coverage
coverageExcludedPackages := ".*\\.BuildInfo.*;.*\\.Tag.*;.*\\.UID.*;.*\\.TagToKeyword.*;.*\\.TagToVR.*;.*\\.TagToVM.*"
// publish
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 }
pomExtra :=
<url>https://github.com/slicebox/dicom-streams</url>
<developers>
<developer>
<id>KarlSjostrand</id>
<name>Karl Sjöstrand</name>
<url>https://github.com/KarlSjostrand</url>
</developer>
</developers>