This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sbt
106 lines (92 loc) · 3.96 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
import sbt.url
import sbtrelease.ReleaseStateTransformations._
Global / onChangedBuildSource := ReloadOnSourceChanges
Global / excludeLintKeys := Set(name, pomIncludeRepository, publishMavenStyle, git.useGitDescribe)
ThisBuild / name := "freya"
ThisBuild / scalaVersion := "2.13.6"
ThisBuild / organization := "io.github.novakov-alexey"
ThisBuild / watchBeforeCommand := Watch.clearScreen
// Publishing config //////////////////////////////////////////////////////
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credential")
ThisBuild / scmInfo := Some(
ScmInfo(url("https://github.com/novakov-alexey/freya"), "scm:git:git@github.com:novakov-alexey/freya.git")
)
ThisBuild / developers := List(
Developer(
id = "novakov-alexey",
name = "Alexey Novakov",
email = "novakov.alex@gmail.com",
url = url("https://github.com/novakov-alexey")
)
)
ThisBuild / description := "Kubernetes Operator library for Scala"
ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / homepage := Some(url("https://github.com/novakov-alexey/freya"))
// Remove all additional repository other than Maven Central from POM
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishMavenStyle := true
// Publishing config end /////////////////////////////////////////////////////////
ThisBuild / Test / fork := true
releaseProcess := Seq.empty[ReleaseStep]
releaseProcess ++= (if (sys.env.contains("RELEASE_VERSION_BUMP"))
Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("publishSigned"),
releaseStepCommand("sonatypeBundleRelease")
)
else Seq.empty[ReleaseStep])
releaseProcess ++= (if (sys.env.contains("RELEASE_PUBLISH"))
Seq[ReleaseStep](inquireVersions, setNextVersion, commitNextVersion, pushChanges)
else Seq.empty[ReleaseStep])
lazy val freya = (project in file(".")).aggregate(`core`, `api`, `jackson`, `circe`).settings(publish / skip := true)
lazy val `api` = (project in file("api"))
.settings(moduleName := "freya-api")
lazy val `core` = (project in file("core"))
.settings(moduleName := "freya-core")
.settings(
addCompilerPlugin(betterMonadicFor),
Test / publishArtifact := false,
libraryDependencies ++= Seq(
k8sClient,
k8sModel,
k8sServerMock % Test,
catsEffect,
scalaLogging,
circeGeneric % Test,
scalaTest % Test,
scalaCheck % Test,
scalaTestCheck % Test,
logbackClassic % Test,
jacksonJsonSchema % Test,
scalaJsonSchema % Test
),
git.useGitDescribe := true
)
.dependsOn(`api`, `jackson` % "test", `circe` % "test")
.enablePlugins(GitVersioning)
lazy val `jackson` = (project in file("jackson"))
.settings(moduleName := "freya-jackson", libraryDependencies ++= Seq(jacksonScala, jacksonDataFormat))
.dependsOn(`api`)
lazy val `circe` = (project in file("circe"))
.settings(moduleName := "freya-circe", libraryDependencies ++= Seq(circeCore, circeParser, circeYaml))
.dependsOn(`api`)
lazy val docs = project
.settings(moduleName := "freya-docs")
.settings(libraryDependencies += circeExtra)
.settings(
Compile / scalacOptions -= "-Wunused:imports",
publishArtifact := false,
mdocIn := file("docs/docs"),
mdocVariables := Map(
"VERSION" -> git.gitDescribedVersion.value.flatMap(_.split("-").headOption).getOrElse("<version>")
)
)
.dependsOn(`core` % "compile->test")
.enablePlugins(MdocPlugin, DocusaurusPlugin)
lazy val generateSchema = taskKey[Unit]("Generate JSON Schema")
generateSchema := (Test / runMain).toTask("freya.ScalaJsonSchema").value