forked from raquo/laminar-shoelace-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
76 lines (69 loc) · 2.85 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
import VersionHelper.{versionFmt, fallbackVersion}
// Lets me depend on Maven Central artifacts immediately without waiting
resolvers ++= Resolver.sonatypeOssRepos("public")
// Makes sure to increment the version for local development
ThisBuild / version := dynverGitDescribeOutput.value
.mkVersion(out => versionFmt(out, dynverSonatypeSnapshots.value), fallbackVersion(dynverCurrentDate.value))
ThisBuild / dynver := {
val d = new java.util.Date
sbtdynver.DynVer
.getGitDescribeOutput(d)
.mkVersion(out => versionFmt(out, dynverSonatypeSnapshots.value), fallbackVersion(d))
}
ThisBuild / scalaVersion := Versions.Scala_3
lazy val generateShoelace = taskKey[Unit]("generates the component definitions")
lazy val sl = project
.in(file("."))
.enablePlugins(ScalaJSPlugin)
.settings(
generateShoelace := {
new ShoelaceGenerator(
onlineSourceRoot = "https://github.com/raquo/laminar-shoelace-components/blob/master",
customElementsJsonPath = "node_modules/@shoelace-style/shoelace/dist/custom-elements.json",
baseOutputDirectoryPath = "src/main/scala/com/raquo/laminar/shoelace/sl",
baseOutputPackagePath = "com.raquo.laminar.shoelace.sl"
).generate()
}
)
.settings(
libraryDependencies ++= List(
"com.raquo" %%% "laminar" % Versions.Laminar % "provided"
),
(Compile / doc / scalacOptions) ++= Seq(
"-no-link-warnings" // Suppress scaladoc "Could not find any member to link for" warnings
),
scalacOptions ++= Seq(
"-deprecation"
),
scalacOptions ++= sys.env.get("CI").map { _ =>
val localSourcesPath = (LocalRootProject / baseDirectory).value.toURI
val remoteSourcesPath = s"https://raw.githubusercontent.com/raquo/laminar-shoelace-components/${git.gitHeadCommit.value.get}/"
val sourcesOptionName = if (scalaVersion.value.startsWith("2.")) "-P:scalajs:mapSourceURI" else "-scalajs-mapSourceURI"
s"${sourcesOptionName}:$localSourcesPath->$remoteSourcesPath"
},
)
.settings(
name := "Laminar Shoelace",
normalizedName := "laminar-shoelace",
organization := "com.raquo",
homepage := Some(url("https://github.com/raquo/laminar-shoelace-components")),
licenses += ("MIT", url("https://github.com/raquo/laminar-shoelace-components/blob/master/LICENSE.md")),
scmInfo := Some(
ScmInfo(
url("https://github.com/raquo/laminar-shoelace-components"),
"scm:[email protected]/raquo/laminar-shoelace-components.git"
)
),
developers := List(
Developer(
id = "raquo",
name = "Nikita Gazarov",
email = "[email protected]",
url = url("https://github.com/raquo")
)
),
(Test / publishArtifact) := false,
pomIncludeRepository := { _ => false },
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
)