-
Notifications
You must be signed in to change notification settings - Fork 103
/
build.sbt
172 lines (163 loc) · 5 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
// General
ThisBuild / organization := "com.earldouglas"
// Scalafix
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
ThisBuild / scalacOptions += "-Ywarn-unused-import"
ThisBuild / scalacOptions += s"-P:semanticdb:sourceroot:${baseDirectory.value}"
// Testing
ThisBuild / libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % "test"
ThisBuild / Test / fork := true
def warRunnerVersion(servletSpec: String) =
Def.setting {
version.value
.split("-")
.toList match {
case v :: Nil => s"""${v}_${servletSpec}"""
case v :: t => s"""${v}_${servletSpec}-${t.mkString("-")}"""
case _ => throw new Exception("wat")
}
}
lazy val warRunner_3_0 =
project
.in(file("runners/3.0"))
.settings(
name := "war-runner",
version := warRunnerVersion("3.0").value,
Compile / compile / javacOptions ++=
Seq(
"-source",
"11",
"-target",
"11",
"-g:lines"
),
crossPaths := false, // exclude Scala suffix from artifact names
autoScalaLibrary := false, // exclude scala-library from dependencies
libraryDependencies += "com.github.jsimone" % "webapp-runner" % "7.0.91.0"
)
lazy val warRunner_3_1 =
project
.in(file("runners/3.1"))
.settings(
name := "war-runner",
version := warRunnerVersion("3.1").value,
Compile / compile / javacOptions ++=
Seq(
"-source",
"11",
"-target",
"11",
"-g:lines"
),
crossPaths := false, // exclude Scala suffix from artifact names
autoScalaLibrary := false, // exclude scala-library from dependencies
libraryDependencies += "com.heroku" % "webapp-runner" % "8.5.68.1"
)
lazy val warRunner_4_0 =
project
.in(file("runners/4.0"))
.settings(
name := "war-runner",
version := warRunnerVersion("4.0").value,
Compile / compile / javacOptions ++=
Seq(
"-source",
"11",
"-target",
"11",
"-g:lines"
),
crossPaths := false, // exclude Scala suffix from artifact names
autoScalaLibrary := false, // exclude scala-library from dependencies
libraryDependencies += "com.heroku" % "webapp-runner" % "9.0.97.0"
)
lazy val warRunner_6_0 =
project
.in(file("runners/6.0"))
.settings(
name := "war-runner",
version := warRunnerVersion("6.0").value,
Compile / compile / javacOptions ++=
Seq(
"-source",
"11",
"-target",
"11",
"-g:lines"
),
crossPaths := false, // exclude Scala suffix from artifact names
autoScalaLibrary := false, // exclude scala-library from dependencies
libraryDependencies += "com.heroku" % "webapp-runner" % "10.1.33.0"
)
lazy val sbtWar =
project
.in(file("."))
.enablePlugins(SbtPlugin)
.enablePlugins(BuildInfoPlugin)
.settings(
name := "sbt-war",
sbtPlugin := true,
scalacOptions ++= Seq("-feature", "-deprecation"),
scalaVersion := "2.12.18",
//
// scripted-plugin
scriptedBufferLog := false,
watchSources ++= { (sourceDirectory.value ** "*").get },
scriptedLaunchOpts += "-DtemplateDirectory=" + (sourceDirectory.value / "template"),
scriptedBatchExecution := true,
scriptedParallelInstances := 8,
//
// sbt-buildinfo
buildInfoPackage := "com.earldouglas.sbt.war",
buildInfoKeys := Seq[BuildInfoKey](version)
)
.aggregate(
warRunner_3_0,
warRunner_3_1,
warRunner_4_0,
warRunner_6_0
)
// Publish to Sonatype, https://www.scala-sbt.org/release/docs/Using-Sonatype.html
ThisBuild / credentials := List(
Credentials(Path.userHome / ".sbt" / "sonatype_credentials")
)
ThisBuild / description := "Package and run .war files with sbt"
ThisBuild / developers := List(
Developer(
id = "earldouglas",
name = "James Earl Douglas",
email = "[email protected]",
url = url("https://earldouglas.com/")
)
)
ThisBuild / homepage := Some(
url("https://github.com/earldouglas/sbt-war")
)
ThisBuild / licenses := List(
"BSD New" -> url("https://opensource.org/licenses/BSD-3-Clause")
)
ThisBuild / organizationHomepage := Some(
url("https://earldouglas.com/")
)
ThisBuild / organizationName := "James Earl Douglas"
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := Some(
"releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"
)
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) {
Some("snapshots" at nexus + "content/repositories/snapshots")
} else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
}
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/earldouglas/sbt-war"),
"scm:[email protected]:earldouglas/sbt-war.git"
)
)
ThisBuild / versionScheme := Some("semver-spec")