-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
86 lines (75 loc) · 2.53 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
addCommandAlias(
"sanity",
"compile ;assembly"
)
lazy val copyJarsTask = taskKey[Unit]("Copy required jars to the lib folder")
val projectName = "dqsuite"
val glueVersion = "4.0.0"
val sparkVersion = "3.3.0"
val scalaCompatVersion = "2.12"
val scalaVersion_ = s"$scalaCompatVersion.15"
val awsSdkVersion = "2.20.32"
val awsJavaSdkVersion = "1.12.128"
ThisBuild / version := sys.env.getOrElse("VERSION", "0.2.0")
ThisBuild / scalaVersion := scalaVersion_
lazy val root = (project in file("."))
.disablePlugins(AssemblyPlugin)
.settings(commonSettings)
.aggregate(
core,
examples,
)
lazy val core = (project in file("core"))
.settings(
commonSettings,
assemblyPackageScala / assembleArtifact := false,
assembly / assemblyJarName := s"$projectName-bundle_$scalaCompatVersion-${version.value}.jar",
// assembly / assemblyOutputPath := file(s"out/libs/${(assembly / assemblyJarName).value}"),
name := projectName,
libraryDependencies ++= commonDependencies ++ coreDependencies
)
lazy val examples = (project in file("examples"))
.disablePlugins(AssemblyPlugin)
.settings(
name := "examples",
commonSettings,
examplesSettings,
libraryDependencies ++= commonDependencies ++ examplesDependencies
)
.dependsOn(
core
)
lazy val commonDependencies = Seq(
"com.amazon.deequ" % "deequ" % "2.0.3-spark-3.3" % Provided,
)
lazy val coreDependencies = Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion_,
"org.yaml" % "snakeyaml" % "2.0",
// Included in AWS Glue 4.0.0
"software.amazon.awssdk" % "timestreamwrite" % awsSdkVersion % Provided,
"software.amazon.awssdk" % "cloudwatch" % awsSdkVersion % Provided,
// "com.amazonaws" % "aws-java-sdk-cloudwatchmetrics" % awsJavaSdkVersion % Provided,
"com.typesafe" % "config" % "1.3.3" % Provided,
)
lazy val examplesDependencies = Seq(
"com.amazonaws" % "AWSGlueETL" % glueVersion % Provided,
)
lazy val examplesSettings = Seq(
resolvers ++=
Resolver.sonatypeOssRepos("releases") ++ Seq(
"aws-glue-etl-artifacts" at "https://aws-glue-etl-artifacts.s3.amazonaws.com/release/",
)
)
lazy val commonSettings = Seq(
copyJarsTask := {
val folder: File = new File((Compile / packageBin / artifactPath).value.getParent)
println(s"Copying artifacts to ${folder}")
// Copy dependencies
(Compile / managedClasspath).value.files
.filter(_.getName.contains("deequ"))
.foreach { f =>
println(s"Copying ${f.getName}")
IO.copyFile(f, folder / f.getName, CopyOptions().withOverwrite(false))
}
}
)