-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
62 lines (55 loc) · 1.67 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
val scala213 = "2.13.3"
val scala3 = "3.0.0-RC1"
Global / onChangedBuildSource := ReloadOnSourceChanges
ThisBuild / crossScalaVersions := Seq(scala213, scala3)
ThisBuild / scalaVersion := scala213
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
// RefPredicate.Equals(Ref.Branch("master")) // disabled until scala 3 is out - publish fails with it
)
ThisBuild / githubWorkflowEnv := Map(
"PACKAGE_WRITE_TOKEN" -> "${{ secrets.PACKAGE_WRITE_TOKEN }}"
)
def withGithubPublish(project: Project): Project = {
scala.util.Try(scala.sys.env("PACKAGE_WRITE_TOKEN")).toOption.map { _ =>
project
.settings(
githubOwner := "tomasherman",
githubRepository := "netty4s",
githubTokenSource := TokenSource.Environment("PACKAGE_WRITE_TOKEN")
)
} getOrElse {
project.disablePlugins(GitHubPackagesPlugin)
}
}
lazy val root = withGithubPublish(project)
.in(file("."))
.settings(publish := false)
.aggregate(examples, core)
lazy val examples = withGithubPublish(project)
.in(file("code/examples"))
.dependsOn(core)
.settings(
publish := false,
javaOptions := Seq(
"--add-opens java.base/jdk.internal.misc=ALL-UNNAMED",
"-Dio.netty.tryReflectionSetAccessible=true"
),
fork := true,
libraryDependencies ++= Seq(
ExamplesDependencies.FS2.core,
ExamplesDependencies.Circe.generic
)
)
lazy val core = withGithubPublish(project)
.in(file("code/core"))
.settings(
libraryDependencies ++= Seq(
Dependencies.Cats.effect,
Dependencies.Netty.all,
Dependencies.Logging.airframeLog,
Dependencies.Circe.core
)
)
name := "netty4s"
organization := "tomasherman"
version := "1.0"