forked from playframework/play-soap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
84 lines (76 loc) · 2.65 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
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
import Dependencies.Versions
import de.heikoseeberger.sbtheader.FileType
import Dependencies.ScalaVersions._
lazy val root = project
.in(file("."))
.aggregate(client, plugin, docs)
.settings(
name := "play-soap",
crossScalaVersions := Nil,
publish / skip := true
)
lazy val client = project
.in(file("client"))
.settings(
name := "play-soap-client",
description := "play-soap client",
crossScalaVersions := Seq(scala212, scala213),
Dependencies.`play-client`,
)
lazy val plugin = project
.in(file("sbt-plugin"))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-play-soap",
organization := "com.typesafe.sbt",
description := "play-soap sbt plugin",
Dependencies.plugin,
crossScalaVersions := Seq(scala212),
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % Versions.Play),
(Compile / resourceGenerators) += generateVersionFile.taskValue,
scriptedLaunchOpts ++= Seq(
s"-Dscala.version=${scalaVersion.value}",
s"-Dscala.crossVersions=${(client / crossScalaVersions).value.mkString(",")}",
s"-Dproject.version=${version.value}",
s"-Dcxf.version=${Versions.CXF}",
),
scriptedBufferLog := false,
scriptedDependencies := (())
)
lazy val docs = (project in file("docs"))
.enablePlugins(SbtTwirl)
.enablePlugins(SbtWeb)
.settings(
crossScalaVersions := Seq(scala212),
headerMappings := headerMappings.value + (FileType("html") -> HeaderCommentStyle.twirlStyleBlockComment),
(Compile / headerSources) ++= (Compile / TwirlKeys.compileTemplates / sources).value,
WebKeys.pipeline ++= {
val clientDocs = (client / Compile / packageDoc / mappings).value.map { case (file, _name) =>
file -> ("api/client/" + _name)
}
val pluginDocs = (plugin / Compile / packageDoc / mappings).value.map { case (file, _name) =>
file -> ("api/sbtwsdl/" + _name)
}
clientDocs ++ pluginDocs
},
publish / skip := true
)
def generateVersionFile =
Def.task {
val clientVersion = (client / version).value
val pluginVersion = version.value
val file = (Compile / resourceManaged).value / "play-soap.version.properties"
val content =
s"""play-soap-client.version=$clientVersion
|sbt-play-soap.version=$pluginVersion
""".stripMargin
if (!file.exists() || !(IO.read(file) == content)) {
IO.write(file, content)
}
Seq(file)
}
(ThisBuild / dynverVTagPrefix) := false
addCommandAlias("validateCode", "headerCheckAll; scalafmtSbtCheck; scalafmtCheckAll; javafmtCheckAll")