-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
134 lines (122 loc) · 4.23 KB
/
build.sbt
File metadata and controls
134 lines (122 loc) · 4.23 KB
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
lazy val scala212 = "2.12.21"
lazy val scala213 = "2.13.18"
lazy val scala3 = "3.7.4"
lazy val supportedScalaVersions = List(scala212, scala213, scala3)
lazy val supportedScalaSbtVersions = List(scala212, scala3)
javacOptions ++= Seq(
"-encoding",
"UTF-8"
)
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-unchecked",
"-encoding",
"UTF-8"
) ++
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => Seq("-Xsource:3")
case _ => Seq.empty
})
// There are some "unused" settings from sbt-git, disabling this check to not pollute logs
Global / lintUnusedKeysOnLoad := false
// Publishing settings
organization := "me.seroperson"
licenses := List("MIT" -> url("https://opensource.org/licenses/MIT"))
homepage := Some(url("https://github.com/seroperson/jvm-live-reload"))
scmInfo := Some(
ScmInfo(
url("https://github.com/seroperson/jvm-live-reload"),
"scm:git:git://github.com/seroperson/jvm-live-reload.git",
Some("scm:git:ssh://git@github.com/seroperson/jvm-live-reload.git")
)
)
developers := List(
Developer(
id = "seroperson",
name = "Daniil Sivak",
email = "seroperson@gmail.com",
url = url("https://seroperson.me/")
)
)
commands ++= Seq(Commands.quickPublish, Commands.catVersion)
addCommandAlias(
"quickLocalPublish",
"quickPublish;publishM2;publishLocal;catVersion"
)
addCommandAlias("quickScripted", "quickPublish;scripted")
// if version was pinned already, read from file, otherwise generate new
version := {
val versionFile = file("version.txt")
if (versionFile.exists()) {
IO.read(versionFile).trim
} else {
version.value
}
}
lazy val javaProjectSettings = Seq(
crossScalaVersions := List(scala212),
crossPaths := false,
autoScalaLibrary := false,
Compile / unmanagedSourceDirectories := (Compile / javaSource).value :: Nil
)
LocalRootProject / name := "root"
LocalRootProject / publish / skip := true
LocalRootProject / publishLocal / skip := true
LocalRootProject / publishM2 / skip := true
lazy val `sbtLiveReload` = (projectMatrix in file("sbt"))
.enablePlugins(SbtPlugin, BuildInfoPlugin)
.settings(
name := "sbt-live-reload",
description := "Provides an universal Live Reload experience for web applications built with sbt",
scriptedBufferLog := false,
scriptedBatchExecution := false,
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.12.0"
case _ => "2.0.0-RC8"
}
},
buildInfoKeys := Seq[BuildInfoKey](version),
buildInfoPackage := "me.seroperson.reload.live.sbt",
scriptedLaunchOpts += version.apply { v => s"-Dproject.version=$v" }.value
)
.jvmPlatform(scalaVersions = supportedScalaSbtVersions)
.dependsOn(`buildLink`, `runner`)
lazy val `webserver` = (project in file("core/webserver"))
.settings(javaProjectSettings)
.settings(
name := "jvm-live-reload-webserver",
description := "Development-mode proxy webserver for Live Reload experience on JVM",
libraryDependencies := Seq(Dependencies.undertow)
)
.dependsOn(`buildLink`)
lazy val `runner` = (project in file("core/runner"))
.settings(javaProjectSettings)
.settings(
name := "jvm-live-reload-runner",
description := "Contains an universal Live Reload webserver initialization and reloading logic",
libraryDependencies := Seq(Dependencies.playFileWatch, Dependencies.jline)
)
.dependsOn(`buildLink`)
lazy val `buildLink` = (project in file("core/build-link"))
.settings(javaProjectSettings)
.settings(
name := "jvm-live-reload-build-link",
description := "Contains classes which shared between build system and application runtime"
)
lazy val `hookScala` = (projectMatrix in file("core/hook-scala"))
.settings(
name := "jvm-live-reload-hook-scala",
description := "Predefined set of hooks for popular Scala webframeworks",
libraryDependencies := Seq(
Dependencies.zio % Provided,
Dependencies.catsEffect % Provided
) ++ (scalaBinaryVersion.value match {
// https://github.com/sbt/sbt/issues/8328
case "3" => Seq("org.scala-lang" %% "scala3-library" % scalaVersion.value)
case _ => Seq.empty
})
)
.jvmPlatform(scalaVersions = supportedScalaVersions)
.dependsOn(`buildLink`)