This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
105 lines (92 loc) · 2.89 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
val runtimeLibrarySettings = Seq(
crossScalaVersions := Seq("2.13.0", "2.12.8", "2.11.12"),
scalaVersion := crossScalaVersions.value.head
)
val sbtPluginSettings = Seq(
crossScalaVersions := Seq("2.12.8"),
scalaVersion := crossScalaVersions.value.head
)
val PlayVersion = "2.7.3"
val PlayJsonVersion = "2.7.4"
val WebJarsLocatorCoreVersion = "0.37"
def playLibrary(name: String): ModuleID =
"com.typesafe.play" %% name % PlayVersion
lazy val `lightbend-markdown` = (project in file("."))
.settings(
common,
crossScalaVersions := Nil,
skip in publish := true,
)
.aggregate(server, plugin, theme)
lazy val playDoc = "com.typesafe.play" %% "play-doc" % "2.0.2"
lazy val server = (project in file("server"))
.enablePlugins(SbtTwirl)
.settings(
name := "lightbend-markdown-server",
common,
runtimeLibrarySettings,
libraryDependencies ++= Seq(
playLibrary("play-akka-http-server"),
playLibrary("play-logback"),
playDoc,
"com.github.scopt" %% "scopt" % "3.7.1",
"org.webjars" % "webjars-locator-core" % WebJarsLocatorCoreVersion
)
)
lazy val plugin = (project in file("plugin"))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-lightbend-markdown",
common,
sbtPluginSettings,
libraryDependencies ++= Seq(
"org.webjars" % "webjars-locator-core" % WebJarsLocatorCoreVersion,
playDoc,
"com.typesafe.play" %% "play-json" % PlayJsonVersion
),
resourceGenerators in Compile += generateVersionFile.taskValue,
)
lazy val theme = (project in file("theme"))
.enablePlugins(SbtWeb, SbtTwirl)
.settings(
name := "lightbend-markdown-builtin-theme",
common,
runtimeLibrarySettings,
libraryDependencies ++= Seq(
"org.webjars" % "jquery" % "1.9.1",
"org.webjars" % "prettify" % "4-Mar-2013"
),
pipelineStages in Assets := Seq(uglify),
LessKeys.compress := true
).dependsOn(server)
import ReleaseTransformations._
def common: Seq[Setting[_]] = Seq(
organization := "com.lightbend.markdown",
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
bintrayOrganization := Some("typesafe"),
bintrayRepository := "ivy-releases",
bintrayPackage := "lightbend-markdown",
bintrayReleaseOnPublish := false,
publishMavenStyle := false,
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
releaseStepTask(bintrayRelease in thisProjectRef.value),
setNextVersion,
commitNextVersion,
pushChanges
)
)
def generateVersionFile = Def.task {
val version = (Keys.version in server).value
val file = (resourceManaged in Compile).value / "lightbend-markdown.version.properties"
val content = s"lightbend-markdown.version=$version"
IO.write(file, content)
Seq(file)
}