This repository has been archived by the owner on Jan 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sbt
100 lines (83 loc) · 3.54 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 com.typesafe.sbt.GitPlugin.autoImport._
import sbt.Keys._
import sbtassembly.MergeStrategy
name := "wdltool"
organization := "org.broadinstitute"
scalaVersion := "2.12.1"
val catsV = "1.0.0-MF"
val wdl4sV = "0.16-8b84d1f-SNAP"
lazy val versionSettings = Seq(
// Upcoming release, or current if we're on the master branch
git.baseVersion := "0.15",
// Shorten the git commit hash
git.gitHeadCommit := git.gitHeadCommit.value map { _.take(7) },
// Travis will deploy tagged releases, add -SNAPSHOT for all local builds
git.gitUncommittedChanges := true,
// For now, obfuscate SNAPSHOTs from sbt's developers: https://github.com/sbt/sbt/issues/2687#issuecomment-236586241
git.uncommittedSignifier := Option("SNAP")
)
versionWithGit ++ versionSettings
assemblyJarName in assembly := "wdltool-" + git.baseVersion.value + ".jar"
logLevel in assembly := Level.Info
resolvers ++= Seq(
"Broad Artifactory Releases" at "https://broadinstitute.jfrog.io/broadinstitute/libs-release/",
"Broad Artifactory Snapshots" at "https://broadinstitute.jfrog.io/broadinstitute/libs-snapshot/"
)
val catsDependencies = List(
"org.typelevel" %% "cats-core" % catsV,
"org.typelevel" %% "kittens" % "1.0.0-M10",
"com.github.benhutchison" %% "mouse" % "0.10-MF"
) map (_
/*
Exclude test framework cats-laws and its transitive dependency scalacheck.
If sbt detects scalacheck, it tries to run it.
Explicitly excluding the two problematic artifacts instead of including the three (or four?).
https://github.com/typelevel/cats/tree/v0.7.2#getting-started
Re "_2.11" and "_2.12", see also: https://github.com/sbt/sbt/issues/1518
*/
exclude("org.typelevel", "cats-laws_2.11")
exclude("org.typelevel", "cats-kernel-laws_2.11")
exclude("org.typelevel", "cats-laws_2.12")
exclude("org.typelevel", "cats-kernel-laws_2.12")
)
libraryDependencies ++= Seq(
"org.broadinstitute" %% "wdl4s-wdl" % wdl4sV,
"org.broadinstitute" %% "wdl4s-cwl" % wdl4sV,
//---------- Test libraries -------------------//
"org.scalatest" %% "scalatest" % "3.0.1" % Test
) ++ catsDependencies
val customMergeStrategy: String => MergeStrategy = {
case x if Assembly.isConfigFile(x) =>
MergeStrategy.concat
case PathList(ps@_*) if Assembly.isReadme(ps.last) || Assembly.isLicenseFile(ps.last) =>
MergeStrategy.rename
case PathList("META-INF", path@_*) =>
path map {
_.toLowerCase
} match {
case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) =>
MergeStrategy.discard
case ps@(x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") =>
MergeStrategy.discard
case "plexus" :: xs =>
MergeStrategy.discard
case "spring.tooling" :: xs =>
MergeStrategy.discard
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case ("spring.schemas" :: Nil) | ("spring.handlers" :: Nil) =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.deduplicate
}
case "asm-license.txt" | "overview.html" | "cobertura.properties" =>
MergeStrategy.discard
case _ => MergeStrategy.deduplicate
}
assemblyMergeStrategy in assembly := customMergeStrategy
// The reason why -Xmax-classfile-name is set is because this will fail
// to build on Docker otherwise. The reason why it's 200 is because it
// fails if the value is too close to 256 (even 254 fails). For more info:
//
// https://github.com/sbt/sbt-assembly/issues/69
// https://github.com/scala/pickling/issues/10
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-Xmax-classfile-name", "200")