-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sbt
85 lines (77 loc) · 2.58 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
import Dependencies._
import sbt.Keys.testFrameworks
import sbtghpackages.GitHubPackagesPlugin.autoImport._
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
// Custom keys
val apiBaseDirectory = settingKey[File]("The base directory for Iris gRPC specifications")
ThisBuild / apiBaseDirectory := baseDirectory.value / "../api"
inThisBuild(
Seq(
organization := "io.iohk.atala",
scalaVersion := "3.2.0",
fork := true,
run / connectInput := true,
versionScheme := Some("semver-spec"),
githubOwner := "input-output-hk",
githubRepository := "atala-prism-building-blocks",
githubTokenSource := TokenSource.Environment("ATALA_GITHUB_TOKEN")
)
)
def commonProject(project: Project): Project =
project.settings(
githubTokenSource := TokenSource.Environment("ATALA_GITHUB_TOKEN"),
versionScheme := Some("semver-spec"),
resolvers += Resolver
.githubPackages("input-output-hk"),
// Needed for Kotlin coroutines that support new memory management mode
resolvers +=
"JetBrains Space Maven Repository" at "https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven",
)
// Project definitions
lazy val root = project
.in(file("."))
.settings(
name := "iris-service-root"
)
.aggregate(core, sql, server)
lazy val core = commonProject(project)
.in(file("core"))
.settings(
name := "iris-core",
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
libraryDependencies ++= coreDependencies,
// gRPC settings
Compile / PB.targets := Seq(scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"),
Compile / PB.protoSources := Seq(apiBaseDirectory.value / "grpc")
)
lazy val sql = commonProject(project)
.in(file("sql"))
.settings(
name := "iris-sql",
libraryDependencies ++= sqlDependencies
)
.dependsOn(core)
lazy val server = commonProject(project)
.in(file("server"))
.settings(
name := "iris-server",
libraryDependencies ++= serverDependencies,
Docker / maintainer := "atala-coredid@iohk.io",
Docker / dockerUsername := Some("input-output-hk"),
Docker / githubOwner := "atala-prism-building-blocks",
Docker / dockerRepository := Some("ghcr.io"),
Docker / dockerUpdateLatest := true,
dockerExposedPorts := Seq(8081),
dockerBaseImage := "openjdk:11"
)
.enablePlugins(JavaAppPackaging, DockerPlugin)
.dependsOn(core, sql)
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
ReleaseStep(releaseStepTask(server / Docker / publish)),
setNextVersion
)