forked from BlueChipFinancial/flink-statefun4s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
184 lines (172 loc) · 6.37 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import sbtgitflowversion.BranchMatcher._
import sbtgitflowversion.VersionCalculator._
credentials in ThisBuild += Credentials(Path.userHome / ".sbt" / ".credentials")
addCommandAlias("f", ";scalafixAll;scalafmtAll")
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
def scalafixRunExplicitly: Def.Initialize[Task[Boolean]] =
Def.task {
executionRoots.value.exists { root =>
Seq(
scalafix.key,
scalafixAll.key
).contains(root.key)
}
}
lazy val commonSettings = Seq(
organization := "com.bcf",
licenses ++= Seq(("MPL-2.0", url("https://mozilla.org/MPL/2.0"))),
homepage := Some(url("https://github.com/BluechipFinancial/flink-statefun4s")),
developers := List(
Developer(
"tdbgamer",
"Timothy Bess",
url("https://github.com/tdbgamer")
)
),
scalaVersion := "2.13.5",
Compile / scalacOptions ++= Seq(
"-Ymacro-annotations"
),
Compile / console / scalacOptions --= Seq("-Xfatal-warnings", "-Ywarn-unused:imports"),
Compile / doc / scalacOptions --= Seq("-Xfatal-warnings"),
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-sourcepath",
(baseDirectory in LocalRootProject).value.getAbsolutePath
),
scalafixDependencies in ThisBuild += "com.github.liancheng" %% "organize-imports" % "0.+",
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.+" cross CrossVersion.full),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.+"),
scalacOptions --= {
if (!scalafixRunExplicitly.value) Seq() else Seq("-Xfatal-warnings")
},
semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version
tagMatcher := TagMatcher.prefix("v"),
versionPolicy := Seq(
exact("master") -> currentTag(),
exact("develop") -> nextMinor(),
prefix("release/v") -> matching(),
prefixes("feature/", "bugfix/", "hotfix/") -> lastVersionWithMatching(),
any -> unknownVersion
),
Global / excludeLintKeys ++= Set(tagMatcher, versionPolicy),
publishTo := {
val base = "https://bluechipfinancial.jfrog.io/artifactory/sbt-release-oss"
if (isSnapshot.value)
Some("Artifactory Realm" at base + ";build.timestamp=" + new java.util.Date().getTime)
else Some("Artifactory Realm" at base)
},
)
lazy val root = project
.in(file("."))
.settings(commonSettings)
.settings(
name := "flink-statefun4s-root",
crossScalaVersions := Nil,
publish / skip := true
)
.dependsOn(core, example, docs, macros)
.aggregate(core, example, docs, macros)
lazy val circeVersion = "0.+"
lazy val core = project
.in(file("core"))
.settings(commonSettings)
.settings(
name := "flink-statefun4s",
description := "Statefun SDK for Scala",
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value / "scalapb"
),
libraryDependencies ++= Seq(
"com.olegpy" %% "meow-mtl-effects" % "0.+",
"org.typelevel" %% "cats-core" % "2.+",
"org.typelevel" %% "cats-mtl" % "1.+",
"org.typelevel" %% "cats-effect" % "3.+",
"org.http4s" %% "http4s-dsl" % "1.0.0-M23",
"org.http4s" %% "http4s-blaze-server" % "1.0.0-M23",
"org.typelevel" %% "simulacrum" % "1.+",
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
)
)
lazy val macros = project
.in(file("macros"))
.settings(commonSettings)
.settings(
name := "flink-statefun4s-generic",
description := "Statefun SDK for Scala",
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value / "scalapb"
),
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
)
.dependsOn(core)
lazy val example = project
.in(file("example"))
.settings(commonSettings)
.settings(
name := "flink-statefun4s-example",
mainClass := Some("com.bcf.statefun4s.MacroExample"),
description := "Statefun SDK example",
publish / skip := true,
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value / "scalapb"
),
libraryDependencies ++= Seq(
"com.olegpy" %% "meow-mtl-effects" % "0.+",
"org.typelevel" %% "cats-core" % "2.+",
"org.typelevel" %% "cats-mtl" % "1.+",
"org.typelevel" %% "cats-effect" % "3.+",
"org.http4s" %% "http4s-dsl" % "1.0.0-M23",
"org.http4s" %% "http4s-blaze-server" % "1.0.0-M23",
"org.typelevel" %% "simulacrum" % "1.+",
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
// Logging deps
"org.slf4j" % "slf4j-api" % "1.+",
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.+",
"org.apache.logging.log4j" % "log4j-core" % "2.+",
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.+",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.+",
"org.typelevel" %% "log4cats-slf4j" % "2.+"
),
assemblyJarName in assembly := "statefun-greeter-example.jar",
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case _ => MergeStrategy.first
},
)
.dependsOn(core, macros)
lazy val micrositeSettings: Seq[Def.Setting[_]] = Seq(
micrositeName := "flink-statefun4s",
micrositeDescription := "Scala SDK for Flink Statefun",
micrositeBaseUrl := "flink-statefun4s",
micrositeDocumentationUrl := "/flink-statefun4s/docs",
micrositeGithubOwner := "BlueChipFinancial",
micrositeGithubRepo := "flink-statefun4s",
micrositeGithubToken := sys.env.get("GITHUB_TOKEN"),
micrositePushSiteWith := GitHub4s,
micrositeHighlightTheme := "atom-one-light",
micrositeHighlightLanguages ++= Seq("protobuf"),
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.svg"
)
lazy val docs = project
.in(file("project-docs"))
.dependsOn(core)
.settings(commonSettings)
.settings(micrositeSettings)
.settings(
publish / skip := true,
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-client" % "1.0.0-M23",
"org.http4s" %% "http4s-blaze-client" % "1.0.0-M23",
)
)
.enablePlugins(MicrositesPlugin)
.enablePlugins(MdocPlugin)