forked from broadinstitute/picard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
140 lines (110 loc) · 4.04 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
import com.typesafe.sbt.SbtGit._
import de.johoop.testngplugin.TestNGPlugin._
import sbt.Package.ManifestAttributes
name := "picard"
version := "2.1.0"
organization := "com.github.broadinstitute"
javaSource in Compile := baseDirectory.value / "src/java"
javaSource in Test := baseDirectory.value / "src/tests"
unmanagedResourceDirectories in Test := Seq(baseDirectory.value / "src/scripts", baseDirectory.value / "testdata", baseDirectory.value / "src/tests/scripts")
libraryDependencies ++= Seq(
"com.github.samtools" % "htsjdk" % "2.1.0",
("com.google.cloud.genomics" % "gatk-tools-java" % "1.1" % "picardopt").
exclude("org.mortbay.jetty", "servlet-api"),
"org.testng" % "testng" % "6.8.8" % Test
)
testNGSettings
testNGSuites := Seq("src/tests/resources/testng.xml")
autoScalaLibrary := false
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
crossPaths := false
javacOptions in (Compile,doc) ++= Seq("-Xdoclint:none")
versionWithGit
assemblyJarName := s"${name.value}-${version.value}.jar"
val PicardOpt = config("picardopt") extend Compile
val gitVersion = settingKey[String]("The picard head commit git hash.")
gitVersion := git.gitHeadCommit.value.get
unmanagedJars in Compile ~= { uj =>
Seq(Attributed.blank(file(System.getProperty("java.home").dropRight(3) + "lib/tools.jar"))) ++ uj
}
test in assembly := {}
packageOptions := Seq(ManifestAttributes(
("Implementation-Version", s"${version.value}(${gitVersion.value})"),
("Implementation-Vendor", "Broad Institute"),
("Main-Class", "picard.cmdline.PicardCommandLine"),
("Implementation-Title", "PICARD Tools")
))
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")
}
assemblyMergeStrategy in assembly := {
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", xs@_*) =>
xs 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" =>
MergeStrategy.discard
case _ => MergeStrategy.deduplicate
}
assemblyExcludedJars in assembly := {
val cp = (fullClasspath in assembly).value
cp filter { jar =>
jar.data.getName == "gatk-tools-java-picard-1.1.jar" || jar.data.getName == "tools.jar"
}
}
val root = project.in(file(".")).
configs(PicardOpt).
settings(inConfig(PicardOpt)(
Classpaths.configSettings ++ Defaults.configTasks ++ baseAssemblySettings ++ Seq(
test in assembly := {},
assemblyJarName := s"${name.value}-opt-${version.value}.jar",
assemblyExcludedJars in assembly := {
val cp = (fullClasspath in assembly).value
cp filter { jar =>
jar.data.getName == "guava-15.0.jar" || jar.data.getName == "tools.jar"
}
}
)): _*)
pomExtra := <url>http://samtools.github.io/htsjdk/</url>
<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:samtools/htsjdk.git</url>
<connection>scm:git:[email protected]:samtools/htsjdk.git</connection>
</scm>
<developers>
<developer>
<id>picard</id>
<name>Picard Team</name>
<url>http://broadinstitute.github.io/picard/</url>
</developer>
</developers>