-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
53 lines (48 loc) · 1.75 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
import sbt.file
import scala.util.Try
lazy val setPluginVersion = taskKey[Unit]("Set plugin version for scripted tests")
inThisBuild(List(
scalaVersion := "2.12.17",
sbtPlugin := true,
organization := "io.github.johnhungerford.sbt.vite",
organizationName := "johnhungerford",
organizationHomepage := Some(url("https://johnhungerford.github.io")),
homepage := Some(url("https://johnhungerford.github.io")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
startYear := Some(2024),
developers := List(
Developer(
id = "johnhungerford",
name = "John Hungerford",
email = "jiveshungerford@gmail.com",
url = url( "https://johnhungerford.github.io" )
)
),
scmInfo := Some(
ScmInfo(
url("https://github.com/johnhungerford/sbt-vite"),
"scm:git@github.com:johnhungerford/sbt-vite.git"
)
),
scriptedLaunchOpts ++=
Seq("-Xmx1024M", "-Dvite.plugin.version=" + version.value),
))
setPluginVersion := {
IO.listFiles(file("src/sbt-test/sbt-vite")).toList.foreach(file => {
if (file.isDirectory) {
val pluginsSbt =
s"""{
| addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0")
| addSbtPlugin("io.github.johnhungerford.sbt.vite" % "sbt-vite" % "${version.value}")
|}""".stripMargin
Try(IO.write(file / "project" / "plugins.sbt", pluginsSbt))
}
})
}
sbtLauncher := sbtLauncher.dependsOn(setPluginVersion).value
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0")
console / initialCommands := """import sbtvite._"""
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
sonatypeProfileName := "io.github.johnhungerford"
enablePlugins(ScriptedPlugin)