-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
112 lines (104 loc) · 3.4 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
import ReleaseTransformations._
import sbtrelease.ReleaseStateTransformations.setNextVersion
name := "Demo"
organization in ThisBuild := "com.example"
organizationName in ThisBuild := "Example"
scalaVersion := "2.13.2"
lazy val root = (project in file("."))
.settings(commonSettings)
.aggregate(
common,
package1,
package2
)
lazy val common = (project in file("common"))
.settings(
name := "common",
commonSettings,
libraryDependencies ++= Dependencies.Common,
// dependencyOverrides ++= Seq (
// "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3",
// "org.scala-lang.modules" % "scala-xml" % "1.1.0",
// "commons-logging" % "commons-logging" % "1.1.3"
// )
)
lazy val package1 = project.in(file("package1"))
.enablePlugins(PlayScala,BuildInfoPlugin,JavaAppPackaging,DockerPlugin)
.settings(
name := "package1",
commonSettings,
buildInfoOptions += BuildInfoOption.ToJson,
DockerSettings.global,
libraryDependencies ++= Dependencies.Common ++ Dependencies.package1,
dependencyOverrides ++= Seq (),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
releaseStepTask(publish in Docker),
setNextVersion
),
)
.dependsOn(
common % "compile->compile;test->test"
)
lazy val package2 = project.in(file("package2"))
.enablePlugins(JavaAppPackaging, DockerPlugin)
.settings(
name := "package2",
commonSettings,
DockerSettings.global,
libraryDependencies ++= Dependencies.Common ++ Dependencies.package2,
dependencyOverrides ++= Seq (),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
releaseStepTask(publish in Docker),
setNextVersion
),
)
.dependsOn(
common % "compile->compile;test->test",
package1 % "compile->compile;test->test"
)
lazy val commonSettings = Seq(
Global / onChangedBuildSource := ReloadOnSourceChanges,
releaseIgnoreUntrackedFiles := true,
skip in publish := true,
scalacOptions ++= Seq(
"-unchecked",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-deprecation",
"-encoding",
"utf8"
),
resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
)
)
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies, // : ReleaseStep
inquireVersions, // : ReleaseStep
runClean, // : ReleaseStep
runTest, // : ReleaseStep
setReleaseVersion, // : ReleaseStep
commitReleaseVersion, // : ReleaseStep, performs the initial git checks
tagRelease, // : ReleaseStep
publishArtifacts,
releaseStepTask(publish in Docker in package1),
releaseStepTask(publish in Docker in package2), // : ReleaseStep, checks whether `publishTo` is properly set up
setNextVersion, // : ReleaseStep
commitNextVersion, // : ReleaseStep
pushChanges // : ReleaseStep, also checks that an upstream branch is properly configured
)