-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
119 lines (105 loc) · 5.05 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
organization := "com.github.mmolimar"
name := "hoolok"
version := "0.1.0-SNAPSHOT"
scmInfo := Some(ScmInfo(
browseUrl = url("https://github.com/mmolimar/hoolok"),
connection = "scm:[email protected]:mmolimar/hoolok.git",
devConnection = "[email protected]:mmolimar/hoolok.git"
))
scalaVersion := "2.12.12"
libraryDependencies ++= {
val sparkVersion = "3.1.2"
val circeVersion = "0.14.1"
val circeYamlVersion = "0.14.0"
val snakeYamlVersion = "1.29"
val jinjavaVersion = "2.5.9"
val reflectionsVersion = "0.9.12"
val sparkJsonSchemaVersion = "0.6.3"
val abrisVersion = "4.2.0"
val deequVersion = "1.2.2-spark-3.0"
val deltaVersion = "1.0.0"
val javaFakerVersion = "1.0.2"
val scalaTestVersion = "3.2.9"
val mockServer = "5.11.2"
val embeddedKafkaVersion = "2.3.1"
val schemaRegistryVersion = "5.3.4"
Seq(
"org.apache.spark" %% "spark-core" % sparkVersion % Compile excludeAll ExclusionRule(organization = "com.sun.jersey"),
"org.apache.spark" %% "spark-sql" % sparkVersion % Compile excludeAll ExclusionRule(organization = "com.sun.jersey"),
"org.apache.spark" %% "spark-hive" % sparkVersion % Compile excludeAll ExclusionRule(organization = "com.sun.jersey"),
"org.apache.spark" %% "spark-avro" % sparkVersion % Compile excludeAll ExclusionRule(organization = "com.sun.jersey"),
"org.apache.spark" %% "spark-streaming" % sparkVersion % Compile excludeAll ExclusionRule(organization = "com.sun.jersey"),
"org.apache.spark" %% "spark-sql-kafka-0-10" % sparkVersion % Compile excludeAll ExclusionRule(organization = "com.sun.jersey"),
"org.apache.spark" %% "spark-hive" % sparkVersion % Compile excludeAll ExclusionRule(organization = "com.sun.jersey"),
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-yaml" % circeYamlVersion excludeAll ExclusionRule(organization = "org.yaml"),
"org.yaml" % "snakeyaml" % snakeYamlVersion,
"com.hubspot.jinjava" % "jinjava" % jinjavaVersion,
"org.reflections" % "reflections" % reflectionsVersion,
"org.zalando" %% "spark-json-schema" % sparkJsonSchemaVersion,
"za.co.absa" %% "abris" % abrisVersion,
"io.delta" %% "delta-core" % deltaVersion,
"com.github.javafaker" % "javafaker" % javaFakerVersion excludeAll(
ExclusionRule(organization = "org.yaml"),
ExclusionRule(organization = "org.reflections")
),
"com.amazon.deequ" % "deequ" % deequVersion excludeAll ExclusionRule(organization = "org.apache.spark"),
"org.scalatest" %% "scalatest-wordspec" % scalaTestVersion % "it,test",
"org.scalatest" %% "scalatest-shouldmatchers" % scalaTestVersion % "it,test",
"org.mock-server" % "mockserver" % mockServer % "it,test",
"io.github.embeddedkafka" %% "embedded-kafka" % embeddedKafkaVersion % "it,test",
"io.confluent" % "kafka-schema-registry" % schemaRegistryVersion % "it,test"
)
}
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := (Compile / scalastyle).toTask("").value
Compile / compile := ((Compile / compile) dependsOn compileScalastyle).value
Compile / sourceGenerators += {
Def.task {
val file = (Compile / sourceManaged).value / "com" / "github" / "mmolimar" / "hoolok" / "BuildInfo.scala"
IO.write(
file,
s"""package com.github.mmolimar.hoolok
|
|private[hoolok] object BuildInfo {
| val version = "${version.value}"
|}""".stripMargin
)
Seq(file)
}.taskValue
}
resolvers ++= Seq(
"Confluent Maven Repo" at "https://packages.confluent.io/maven/",
"jitpack" at "https://jitpack.io",
Resolver.sonatypeRepo("snapshots"),
Resolver.mavenLocal
)
val hoolokMainClass = "com.github.mmolimar.hoolok.JobRunner"
Compile / run / mainClass := Some(hoolokMainClass)
Compile / run := Defaults.runTask(Compile / fullClasspath, Compile / run / mainClass, Compile / run / runner).evaluated
fork / run := true
assembly / mainClass := Some(hoolokMainClass)
assembly / assemblyMergeStrategy := {
case "plugin.xml" => MergeStrategy.discard
case "git.properties" => MergeStrategy.discard
case "jetty-dir.css" => MergeStrategy.discard
case "module-info.class" => MergeStrategy.discard
case "log4j.properties" => MergeStrategy.discard
case "NOTICE" => MergeStrategy.discard
case "MANIFEST.MF" => MergeStrategy.discard
case PathList("META-INF", _*) => MergeStrategy.discard
case PathList(ps@_*) if ps.last contains "LICENSE" => MergeStrategy.first
case PathList("org", "apache", _*) => MergeStrategy.first
case PathList("javax", _*) => MergeStrategy.first
case PathList("com", "sun", _*) => MergeStrategy.first
case PathList("org", "aopalliance", _*) => MergeStrategy.first
case PathList("net", "jcip", "annotations", _*) => MergeStrategy.first
case PathList("edu", "umd", "cs", "findbugs", _*) => MergeStrategy.first
case _ => MergeStrategy.deduplicate
}
licenses := Seq("Apache License, Version 2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0"))
import TestSettings._
lazy val root = (project in file("."))
.configs(TestSettings.IntegrationTest)
.settings(hoolokSettings: _*)