-
Notifications
You must be signed in to change notification settings - Fork 131
/
build.sbt
85 lines (78 loc) · 2.78 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
organization in ThisBuild := "com.iheart"
ThisBuild / scalafixDependencies ++= Seq(
"com.github.liancheng" %% "organize-imports" % "0.6.0",
"net.pixiv" %% "scalafix-pixiv-rule" % "4.5.3"
)
addCommandAlias(
"publishForExample",
";set ThisBuild / version := \"0.0.1-EXAMPLE\"; +publishLocal"
)
lazy val noPublishSettings = Seq(
publish / skip := true,
publish := (),
publishLocal := (),
publishArtifact := false
)
lazy val scalaV = "2.12.18"
lazy val root = project.in(file("."))
.aggregate(playSwagger, sbtPlaySwagger)
.settings(
Publish.coreSettings,
sourcesInBase := false,
noPublishSettings,
scalaVersion := scalaV
)
lazy val playSwagger = project.in(file("core"))
.settings(
Publish.coreSettings,
Format.settings,
Testing.settings,
name := "play-swagger",
libraryDependencies ++= Dependencies.playTest ++
Dependencies.playRoutesCompiler ++
Dependencies.playJson ++
Dependencies.enumeratum ++
Dependencies.refined ++
Dependencies.test ++
Dependencies.yaml ++ Seq(
"com.github.takezoe" %% "runtime-scaladoc-reader" % "1.0.3",
"org.scalameta" %% "scalameta" % "4.8.5",
"net.steppschuh.markdowngenerator" % "markdowngenerator" % "1.3.1.1",
"joda-time" % "joda-time" % "2.12.5" % Test,
"com.google.errorprone" % "error_prone_annotations" % "2.20.0" % Test
),
libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always,
addCompilerPlugin("com.github.takezoe" %% "runtime-scaladoc-reader" % "1.0.3"),
scalaVersion := scalaV,
crossScalaVersions := Seq(scalaVersion.value, "2.13.11"),
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq("-Wunused")
case _ => Seq("-Xlint:unused")
})
)
lazy val sbtPlaySwagger = project.in(file("sbtPlugin"))
.settings(
Publish.coreSettings,
Format.settings,
addSbtPlugin("com.typesafe.sbt" %% "sbt-native-packager" % "1.3.17" % Provided),
addSbtPlugin("com.typesafe.sbt" %% "sbt-web" % "1.4.4" % Provided)
)
.enablePlugins(BuildInfoPlugin, SbtPlugin)
.settings(
buildInfoKeys := Seq[BuildInfoKey](name, version),
buildInfoPackage := "com.iheart.playSwagger",
name := "sbt-play-swagger",
description := "sbt plugin for play swagger spec generation",
sbtPlugin := true,
scalaVersion := scalaV,
scripted := scripted.dependsOn(publishLocal in playSwagger).evaluated,
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedBufferLog := false,
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq("-Wunused")
case _ => Seq("-Xlint:unused")
})
)