-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
110 lines (97 loc) · 3.56 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
Global / onChangedBuildSource := ReloadOnSourceChanges
ThisBuild / resolvers ++= Seq(
Resolver.mavenCentral,
"Apache Development Snapshot Repository" at "https://repository.apache.org/content/repositories/snapshots/",
Resolver.mavenLocal
)
name := "flink-sandbox"
version := "0.1"
organization := "org.example"
ThisBuild / scalaVersion := "3.3.1"
ThisBuild / scalacOptions ++= Seq("-new-syntax", "-rewrite")
val flinkVersion = "1.18.1"
val flinkMajorAndMinorVersion =
flinkVersion.split("\\.").toList.take(2).mkString(".")
val log4jVersion = "2.17.1"
val flinkDependencies = Seq(
("org.flinkextended" %% "flink-scala-api" % s"${flinkVersion}_1.1.4")
.excludeAll(
ExclusionRule(organization = "org.apache.flink"),
ExclusionRule(organization = "org.scalameta"),
ExclusionRule(organization = "com.google.code.findbugs")
),
"org.apache.flink" % "flink-runtime-web" % flinkVersion % Provided,
"org.apache.flink" % "flink-clients" % flinkVersion % Provided,
"org.apache.flink" % "flink-state-processor-api" % flinkVersion,
"org.apache.flink" % "flink-csv" % flinkVersion % Provided,
"org.apache.flink" % "flink-connector-kafka" % s"3.0.2-$flinkMajorAndMinorVersion" % Provided,
"org.apache.flink" % "flink-connector-files" % flinkVersion % Provided,
"org.apache.flink" % "flink-table-runtime" % flinkVersion % Provided,
"org.apache.flink" % "flink-table-planner-loader" % flinkVersion % Provided,
"org.apache.flink" % "flink-test-utils" % flinkVersion % Test,
"org.apache.flink" % "flink-streaming-java" % flinkVersion % Test classifier "tests",
"org.scalatest" %% "scalatest" % "3.2.15" % Test
)
lazy val commonSettings = Seq(
Compile / run := Defaults
.runTask(
Compile / fullClasspath,
Compile / run / mainClass,
Compile / run / runner
)
.evaluated,
Compile / run / fork := true
)
lazy val root = (project in file("."))
.aggregate(`core`, `iceberg`, `protobuf`)
.settings(
publish / skip := true
)
def excludeJars(cp: Classpath) =
cp filter { f =>
Set(
"scala-asm-9.4.0-scala-1.jar",
"interface-1.3.5.jar",
"interface-1.0.12.jar",
"jline-terminal-3.19.0.jar",
"jline-reader-3.19.0.jar",
"jline-3.21.0.jar",
"scala-compiler-2.13.10.jar",
"scala3-compiler_3-3.3.1.jar",
"flink-shaded-zookeeper-3-3.7.1-16.1.jar"
).contains(
f.data.getName
)
}
lazy val `core` = (project in file("modules/core"))
.settings(
libraryDependencies ++= flinkDependencies ++ Seq(
"ch.qos.logback" % "logback-classic" % "1.4.14" % Provided,
"io.bullet" %% "borer-core" % "1.14.0" % Provided
),
assemblyPackageScala / assembleArtifact := false,
assembly / assemblyExcludedJars := {
val cp = (assembly / fullClasspath).value
excludeJars(cp)
},
Test / fork := false
)
.settings(commonSettings)
lazy val `iceberg` = (project in file("modules/iceberg"))
.settings(
libraryDependencies ++= flinkDependencies ++ Seq(
"org.apache.iceberg" % "iceberg-flink-runtime-1.17" % "1.4.3" % Provided,
"org.apache.hadoop" % "hadoop-common" % "3.3.4" % Provided,
"org.apache.hadoop" % "hadoop-aws" % "3.3.4" % Provided,
"org.apache.hadoop" % "hadoop-mapreduce-client-core" % "3.3.4" % Provided
),
assemblyPackageScala / assembleArtifact := false,
assembly / assemblyExcludedJars := {
val cp = (assembly / fullClasspath).value
excludeJars(cp)
}
)
.settings(commonSettings)
lazy val `protobuf` =
(project in file("modules/protobuf")).enablePlugins(ProtobufPlugin)
Global / cancelable := true