-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
61 lines (51 loc) · 2.09 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
// Our Scala versions.
lazy val `scala-2.12` = "2.12.17"
lazy val `scala-2.13` = "2.13.10"
lazy val `scala-3` = "3.2.2"
// Publishing
ThisBuild / organization := "org.tpolecat"
ThisBuild / licenses ++= Seq(("MIT", url("http://opensource.org/licenses/MIT")))
ThisBuild / homepage := Some(url("https://github.com/tpolecat/typename"))
ThisBuild / developers := List(
Developer("tpolecat", "Rob Norris", "[email protected]", url("http://www.tpolecat.org"))
)
// Headers
lazy val headerSettings = Seq(
headerMappings := headerMappings.value + (HeaderFileType.scala -> HeaderCommentStyle.cppStyleLineComment),
headerLicense := Some(HeaderLicense.Custom(
"""|Copyright (c) 2020-2021 by Rob Norris
|This software is licensed under the MIT License (MIT).
|For more information see LICENSE or https://opensource.org/licenses/MIT
|""".stripMargin
)
)
)
lazy val root = project.in(file("."))
.aggregate(typename.jvm, typename.js, typename.native)
.settings(
sonatypeCredentialHost := "s01.oss.sonatype.org",
publish / skip := true,
headerSettings
)
lazy val typename = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("typename"))
.settings(
name := "typename",
headerSettings,
// Compilation
scalaVersion := `scala-2.13`,
crossScalaVersions := Seq(`scala-2.12`, `scala-2.13`, `scala-3`),
Compile / doc / scalacOptions --= Seq("-Xfatal-warnings"),
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-sourcepath", (LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url", "https://github.com/tpolecat/typename/blob/v" + version.value + "€{FILE_PATH}.scala",
),
// MUnit
libraryDependencies += "org.scalameta" %%% "munit" % "1.0.0-M6" % Test,
// Scala 2 needs scala-reflect
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value).filterNot(_ => scalaVersion.value.startsWith("3.")),
// Publishing
sonatypeCredentialHost := "s01.oss.sonatype.org"
).enablePlugins(AutomateHeaderPlugin)