-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.sbt
138 lines (115 loc) · 4.76 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
import ReleaseTransformations._
lazy val commonSettings = Seq(
organization := "org.clulab",
// Default to 2.12, but still cross-build for 2.11.
// 2.12.12 results in an exception when trying to access
// a resource through getResource(). There might be a
// change related to the leading / or something similar.
scalaVersion := "2.12.8",
crossScalaVersions := Seq("2.11.12", "2.12.8"),
scalacOptions ++= Seq("-feature", "-unchecked", "-deprecation"),
testOptions in Test += Tests.Argument("-oD"),
parallelExecution in Global := false,
// publish to a maven repo
publishMavenStyle := true,
// the standard maven repository
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")
},
// let’s remove any repositories for optional dependencies in our artifact
pomIncludeRepository := { _ => false },
// mandatory stuff to add to the pom for publishing
pomExtra :=
<url>https://github.com/clulab/reach</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/clulab/reach</url>
<connection>https://github.com/clulab/reach</connection>
</scm>
<developers>
<developer>
<id>mihai.surdeanu</id>
<name>Mihai Surdeanu</name>
<email>[email protected]</email>
</developer>
</developers>
//
// end publishing settings
//
)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.aggregate(processors, main, causalAssembly, export, bioresources)
.dependsOn(main % "test->test;compile", causalAssembly, export) // so that we can import from the console
.settings(
name := "reach-exe",
aggregate in test := true,
aggregate in assembly := false,
test in assembly := {},
assemblyMergeStrategy in assembly := {
// The following line of code deals with these two conflicting files by throwing both away.
// [error] (root/*:assembly) deduplicate: different file contents found in the following:
// [error] ~/.ivy2/cache/com.sun.xml.bind/jaxb-impl/jars/jaxb-impl-2.4.0-b180830.0438.jar:module-info.class
// [error] ~/.ivy2/cache/javax.xml.bind/jaxb-api/jars/jaxb-api-2.4.0-b180830.0359.jar:module-info.class
case PathList("module-info.class") => MergeStrategy.discard
case PathList("com", "sun", "istack", "Pool$Impl.class") => MergeStrategy.first
case PathList("com", "sun", "istack", "XMLStreamReaderToContentHandler.class") => MergeStrategy.first
case PathList("com", "sun", "istack", "localization", "LocalizableMessage.class") => MergeStrategy.first
case PathList("com", "sun", "istack", "localization", "Localizer.class") => MergeStrategy.first
case PathList("com", "sun", "istack", "localization", "NullLocalizable.class") => MergeStrategy.first
case PathList("com", "sun", "istack", "logging", "Logger.class") => MergeStrategy.first
case other => (assemblyMergeStrategy in assembly).value(other)
},
mainClass in assembly := {
val sysMainOpt = Option(System.getProperty("mainClass"))
sysMainOpt.orElse(Some("org.clulab.reach.RunReachCLI"))
},
assemblyJarName in assembly := s"reach-${version.value}-FAT.jar"
)
lazy val bioresources = project
.settings(commonSettings:_*)
// this stores BioNLPProcessor and its models
lazy val processors = project
.settings(commonSettings:_*)
.dependsOn(bioresources % "test->test;compile->compile")
lazy val main = project
.settings(commonSettings:_*)
.dependsOn(processors % "test->test;compile->compile")
// .dependsOn(context % "test->test;compile->compile")
lazy val causalAssembly = project.in(file("assembly"))
.settings(commonSettings:_*)
.dependsOn(main % "test->test;compile->compile")
lazy val context = project.in(file("context"))
.settings(commonSettings:_*)
.dependsOn(main % "test->test;compile->compile")
lazy val export = project
.settings(commonSettings:_*)
.dependsOn(main % "test->test;compile->compile", causalAssembly % "test;compile") // need access to assembly/src/resources
//
// publishing settings
//
// these are the steps to be performed during release
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommandAndRemaining("sonatypeReleaseAll"),
pushChanges
)