-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
114 lines (107 loc) · 3.17 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
val scala212 = "2.12.18"
val scala213 = "2.13.12"
Global / onChangedBuildSource := ReloadOnSourceChanges
scalaVersion := scala212
// val uploadArtifact = TaskKey(...)
inThisBuild(
Seq(
organization := "dev.i10416",
organizationHomepage := Some(new URL("https://github.com/i10416")),
homepage := Some(url("https://github.com/i10416/dbc4s")),
startYear := Some(2022),
licenses := Seq(
"Apache 2.0" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")
),
versionScheme := Some("early-semver"),
developers := List(
Developer(
"i10416",
"110416",
url("https://github.com/i10416")
)
),
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
scmInfo := Some(
ScmInfo(
url("https://github.com/i10416/dbc4s"),
"scm:[email protected];i10416/dbc4s.git"
)
)
)
)
val commonSettings = Seq(
scalacOptions ++= {
import sbt.Opts.compile._
Seq(
deprecation,
unchecked,
"-feature"
) ++ {
if (scalaVersion.value.startsWith("2.12"))
Seq("-language:higherKinds", "-Ypartial-unification")
else Seq.empty
}
}
)
lazy val noPublishSettings = Seq(
publish := (()),
publishLocal := (()),
publishTo := None
)
/** example spark job that calculates approx Pi value.
*/
lazy val pi = project
.in(file("pi"))
.settings(commonSettings)
.settings(noPublishSettings)
.enablePlugins(DBC4sPlugin)
.settings(
run / fork := true,
run / javaOptions := Seq(
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.base/sun.security.action=ALL-UNNAMED"
),
assembly / mainClass := Some("dev.i10416.playground.Program"),
assembly / assemblyMergeStrategy := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case x => MergeStrategy.first
},
dbc4sApiToken := sys.env.get("DBC_TOKEN").getOrElse(""),
dbc4sHost := sys.env.get("DBC_HOST").getOrElse(""),
dbc4sJobName := "Example -- calculate Pi",
libraryDependencies ++= Deps.sparkAll
.map(_ % "provided") ++ Deps.collectionCompat ++ Deps.catsEffect.value
)
/** databricks api types and api client.
*/
lazy val dbcapi = crossProject(JVMPlatform, JSPlatform)
.in(file("dbc4s-api"))
.settings(commonSettings)
.settings(
name := "dbc4s-api",
crossScalaVersions := Seq(scala212, scala213),
run / javaOptions := Seq(
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.base/sun.security.action=ALL-UNNAMED"
),
libraryDependencies ++= Deps.catsEffect.value ++ Deps.fs2.value ++ Deps.http4s.value // ++ Deps.parserCombinator.value
)
lazy val dbc4sPlugin = project
.in(file("dbc4s-sbt-plugin"))
.enablePlugins(SbtPlugin)
.settings(commonSettings)
.settings(
name := "dbc4s-sbt",
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0"),
sbtPlugin := true
)
.dependsOn(dbcapi.jvm)
lazy val root = project
.in(file("."))
.aggregate(pi, dbcapi.jvm, dbc4sPlugin)
.settings(noPublishSettings)
.settings(
name := "dbc4s"
)