forked from eikek/sbt-openapi-schema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
114 lines (105 loc) · 3.05 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
import Dependencies._
import ReleaseTransformations._
ThisBuild / scalaVersion := "2.12.15"
ThisBuild / versionScheme := Some("early-semver")
addCommandAlias("ci", "; lint; test; scripted; publishLocal")
addCommandAlias(
"lint",
"; scalafmtSbtCheck; scalafmtCheckAll; Compile/scalafix --check; Test/scalafix --check"
)
addCommandAlias("fix", "; Compile/scalafix; Test/scalafix; scalafmtSbt; scalafmtAll")
val sharedSettings = Seq(
name := "sbt-openapi-schema",
organization := "com.github.eikek",
scalaVersion := "2.12.15",
licenses := Seq("MIT" -> url("http://spdx.org/licenses/MIT")),
homepage := Some(url("https://github.com/eikek/sbt-openapi-schema")),
Compile / console / scalacOptions := Seq(),
scalacOptions ++= Seq(
"-encoding",
"UTF-8",
"-Xfatal-warnings", // fail when there are warnings
"-deprecation",
"-feature",
"-unchecked",
"-language:higherKinds",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-unused-import",
"-Wconf:cat=unused-nowarn:s"
)
) ++ publishSettings
lazy val publishSettings = Seq(
scmInfo := Some(
ScmInfo(
url("https://github.com/eikek/sbt-openapi-schema.git"),
"scm:git:[email protected]:eikek/sbt-openapi-schema.git"
)
),
developers := List(
Developer(
id = "eikek",
name = "Eike Kettner",
url = url("https://github.com/eikek"),
email = ""
)
),
homepage := Some(url("https://github.com/eikek/sbt-openapi-schema")),
Test / publishArtifact := false,
releaseCrossBuild := false,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
)
lazy val noPublish = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val testSettings = Seq(
testFrameworks += new TestFramework("minitest.runner.Framework"),
libraryDependencies ++= Seq(minitest, `logback-classic`).map(_ % "test")
)
val scalafixSettings = Seq(
semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.6.0"
)
lazy val plugin = project
.in(file("plugin"))
.withId("sbt-openapi-schema")
.enablePlugins(SbtPlugin)
.settings(sharedSettings)
.settings(publishSettings)
.settings(testSettings)
.settings(scalafixSettings)
.settings(
sbtPlugin := true,
libraryDependencies ++= Seq(`swagger-parser`, swaggerCodegen),
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedBufferLog := false
)
lazy val root = project
.in(file("."))
.settings(sharedSettings)
.settings(noPublish)
.settings(
name := "sbt-openapi-schema"
)
.aggregate(plugin)