-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sbt
80 lines (76 loc) · 3.24 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
import Dependencies._
import scala.sys.process.Process
val buildResolvers = Seq(
"Typesafe Repo" at "https://repo.typesafe.com/typesafe/releases/",
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
"Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases",
"Bintray Repo" at "https://dl.bintray.com/spark-packages/maven/"
)
ThisBuild / organization := "io.opentargets"
ThisBuild / version := "1.0.0"
ThisBuild / scalaVersion := "2.12.12"
def jarName(name: String): String = {
val commit = Process(s"git log --oneline").lineStream.head.take(7)
s"$name-$commit.jar"
}
lazy val workflow = (project in file("workflow")).settings(
name := "etl-workflow",
libraryDependencies ++= workflowDependencies,
scalacOptions ++= Seq("-feature",
"-deprecation",
"-unchecked",
"-language:postfixOps",
"-language:higherKinds",
"-Ypartial-unification"
),
coverageEnabled := true,
logLevel in assembly := Level.Info,
mainClass in assembly := Some("io.opentargets.workflow.cli.OpenTargetsCliApp"),
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "io.netty.versions.properties") =>
MergeStrategy.discard
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 "versions" :: xs => MergeStrategy.discard
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case ("spring.schemas" :: Nil) | ("spring.handlers" :: Nil) =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.deduplicate
}
case "module-info.class" => MergeStrategy.filterDistinctLines
case _ => MergeStrategy.deduplicate
},
assembly / assemblyJarName := jarName("workflow")
)
lazy val root = (project in file("."))
.settings(
name := "io-opentargets-etl-backend",
resolvers ++= buildResolvers,
libraryDependencies ++= etlDependencies,
testFrameworks += new TestFramework("minitest.runner.Framework"),
mainClass in (Compile, run) := Some("io.opentargets.etl.Main"),
mainClass in (Compile, packageBin) := Some("io.opentargets.etl.Main"),
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("shapeless.**" -> "new_shapeless.@1").inAll
),
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "services", "org.apache.hadoop.fs.FileSystem") =>
MergeStrategy.filterDistinctLines
case PathList("META-INF", "services", "org.apache.spark.sql.sources.DataSourceRegister") =>
MergeStrategy.concat
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case _ => MergeStrategy.first
},
assembly / assemblyJarName := jarName("etl-backend")
)