-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sbt
174 lines (160 loc) · 5.83 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import sbt.Keys._
import sbt.ThisBuild
import sbtassembly.AssemblyPlugin.autoImport._
import com.typesafe.config._
import org.scalafmt.sbt.ScalafmtPlugin.autoImport.scalafmtConfig
import sbtghpackages.GitHubPackagesPlugin.autoImport.githubOwner
import Merging.customMergeStrategy
def getVersion: String = {
val confPath =
Option(System.getProperty("config.file")).getOrElse("src/main/resources/application.conf")
val conf = ConfigFactory.parseFile(new File(confPath)).resolve()
conf.getString("wdlTools.version")
}
name := "wdlTools"
ThisBuild / organization := "com.dnanexus"
ThisBuild / scalaVersion := "2.13.7"
ThisBuild / developers := List(
Developer("orodeh", "orodeh", "orodeh@dnanexus.com", url("https://github.com/dnanexus")),
Developer("jdidion", "jdidion", "jdidion@dnanexus.com", url("https://github.com/dnanexus")),
Developer("r-i-v-a",
"Riva Nathans",
"rnathans-cf@dnanexus.com",
url("https://github.com/dnanexus"))
)
ThisBuild / homepage := Some(url("https://github.com/dnanexus/wdlTools"))
ThisBuild / scmInfo := Some(
ScmInfo(url("https://github.com/dnanexus/wdlTools"), "git@github.com:dnanexus/wdlTools.git")
)
ThisBuild / licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
lazy val wdlTools = project
.in(file("."))
.settings(
name := "wdlTools",
version := getVersion,
settings,
assemblySettings,
libraryDependencies ++= dependencies,
assembly / assemblyJarName := "wdlTools.jar"
)
lazy val dependencies = {
val dxCommonVersion = "0.11.5"
val antlr4Version = "4.13.1"
val scallopVersion = "4.1.0"
val typesafeVersion = "1.4.1"
val scalateVersion = "1.9.7"
//val beardVersion = "0.3.1"
val sprayVersion = "1.3.6"
val katanVersion = "0.6.2"
val re2jVersion = "1.6"
val graphVersion = "1.13.3"
val scalatestVersion = "3.2.10"
Seq(
"com.dnanexus" % "dxcommon" % dxCommonVersion,
// configuration
"com.typesafe" % "config" % typesafeVersion,
// antlr4 lexer + parser
"org.antlr" % "antlr4" % antlr4Version,
// command line parser
"org.rogach" %% "scallop" % scallopVersion,
// template engine
"org.scalatra.scalate" %% "scalate-core" % scalateVersion,
// TODO: switch to "de.zalando" %% "beard" % beardVersion,
"io.spray" %% "spray-json" % sprayVersion,
// csv parser
"com.nrinaudo" %% "kantan.csv" % katanVersion,
// POSIX regexp library
"com.google.re2j" % "re2j" % re2jVersion,
// graph library
"org.scala-graph" %% "graph-core" % graphVersion,
//---------- Test libraries -------------------//
"org.scalatest" % "scalatest_2.13" % scalatestVersion % "test"
)
}
//resolvers ++= Seq(
// "zalando-maven" at "https://dl.bintray.com/zalando/maven"
//)
val githubDxScalaResolver = Resolver.githubPackages("dnanexus", "dxScala")
val githubWdlToolsResolver = Resolver.githubPackages("dnanexus", "wdlTools")
resolvers ++= Vector(githubWdlToolsResolver, githubDxScalaResolver)
val releaseTarget = Option(System.getProperty("releaseTarget")).getOrElse("github")
lazy val settings = Seq(
scalacOptions ++= compilerOptions,
Compile / doc / scalacOptions ++= Seq("-no-java-comments", "-no-link-warnings"),
javacOptions ++= Seq("-Xlint:deprecation", "-source", "1.8", "-target", "1.8"),
// reduce the maximum number of errors shown by the Scala compiler
maxErrors := 20,
// scalafmt
scalafmtConfig := file(".") / ".scalafmt.conf",
// disable publish with scala version, otherwise artifact name will include scala version
// e.g wdlTools_2.11
crossPaths := false,
// add sonatype repository settings
// snapshot versions publish to sonatype snapshot repository
// other versions publish to sonatype staging repository
publishTo := Some(
if (isSnapshot.value || releaseTarget == "github") {
githubWdlToolsResolver
} else {
Opts.resolver.sonatypeStaging
}
),
githubOwner := "dnanexus",
githubRepository := "wdlTools",
publishMavenStyle := true,
// If an exception is thrown during tests, show the full
// stack trace, by adding the "-oF" option to the list.
//
// exclude the native tests, they are slow.
// to do this from the command line:
// sbt testOnly -- -l native
//
// comment out this line in order to allow native
// tests
// Test / testOptions += Tests.Argument("-l", "native")
Test / testOptions += Tests.Argument("-oF"),
Test / parallelExecution := false
// Coverage
//
// sbt clean coverage test
// sbt coverageReport
// To turn it off do:
// sbt coverageOff
//coverageEnabled := true
// Ignore code parts that cannot be checked in the unit
// test environment
//coverageExcludedPackages := "dxWDL.Main;dxWDL.compiler.DxNI;dxWDL.compiler.DxObjectDirectory;dxWDL.compiler.Native"
)
val compilerOptions = Seq(
"-unchecked",
"-deprecation",
"-feature",
"-explaintypes",
"-encoding",
"UTF-8",
"-Xlint:constant",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Ywarn-dead-code",
"-Ywarn-unused:implicits",
"-Ywarn-unused:privates",
"-Ywarn-unused:locals",
"-Ywarn-unused:imports", // warns about every unused import on every command.
"-Xfatal-warnings" // makes those warnings fatal.
)
// Assembly
lazy val assemblySettings = Seq(
assembly / logLevel := Level.Info,
// comment out this line to enable tests in assembly
assembly / test := {},
assembly / assemblyMergeStrategy := customMergeStrategy.value
)