-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathbuild.sbt
More file actions
101 lines (97 loc) · 3.84 KB
/
build.sbt
File metadata and controls
101 lines (97 loc) · 3.84 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
import Dependencies._
import com.typesafe.tools.mima.core._, ProblemFilters._
ThisBuild / version := {
val old = (ThisBuild / version).value
(sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version")) match {
case Some(v) => v
case _ =>
if ((ThisBuild / isSnapshot).value) "1.6.0-SNAPSHOT"
else old
}
}
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / organization := "org.scala-sbt"
ThisBuild / homepage := Some(url("https://github.com/sbt/io"))
ThisBuild / description := "IO module for sbt"
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/sbt/io"), "git@github.com:sbt/io.git"))
ThisBuild / licenses := List(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")))
ThisBuild / headerLicense := Some(
HeaderLicense.Custom(
s"""sbt IO
|Copyright Scala Center, Lightbend, and Mark Harrah
|
|Licensed under Apache License 2.0
|SPDX-License-Identifier: Apache-2.0
|
|See the NOTICE file distributed with this work for
|additional information regarding copyright ownership.
|""".stripMargin
)
)
ThisBuild / scalafmtOnCompile := !insideCI.value
ThisBuild / developers := List(
Developer("eatkins", "Ethan Atkins", "@eatkins", url("https://www.ethanatkins.com/")),
Developer("harrah", "Mark Harrah", "@harrah", url("https://github.com/harrah")),
Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("http://eed3si9n.com/")),
Developer("dwijnand", "Dale Wijnand", "@dwijnand", url("https://github.com/dwijnand")),
)
ThisBuild / turbo := true
ThisBuild / pomIncludeRepository := (_ => false)
ThisBuild / publishTo := {
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
else localStaging.value
}
def commonSettings: Seq[Setting[?]] = Seq(
scalaVersion := scala3,
compile / javacOptions ++= Seq("-Xlint", "-Xlint:-serial"),
crossScalaVersions := Seq(scala3),
headerLicense := (ThisBuild / headerLicense).value,
)
lazy val ioRoot = (project in file("."))
.aggregate(io)
.settings(
commonSettings,
name := "IO Root",
publish / skip := true,
onLoadMessage := {
""" _
| (_)___
| / / __ \
| / / /_/ /
| /_/\____/
|Welcome to the build for sbt/io.
|""".stripMargin +
(if (sys.props("java.specification.version") != "17")
s"""!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
| Java versions is ${sys.props("java.specification.version")}. We recommend 17.
|!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!""".stripMargin
else "")
},
mimaPreviousArtifacts := Set.empty,
)
// Path, IO (formerly FileUtilities), NameFilter and other I/O utility classes
val io = (project in file("io"))
.enablePlugins(ContrabandPlugin)
.settings(
commonSettings,
name := "IO",
libraryDependencies ++= {
Vector(scalaCompiler.value % Test, scalaVerify % Test, scalaCheck % Test, scalatest % Test)
} ++ Vector(swovalFiles),
testFrameworks += new TestFramework("verify.runner.Framework"),
Test / fork := System.getProperty("sbt.test.fork", "false") == "true",
Test / testForkedParallel := true,
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala",
console / initialCommands += "\nimport sbt.io._, syntax._",
mimaPreviousArtifacts := Set(
"1.10.5"
).map((version: String) => organization.value %% moduleName.value % version),
mimaBinaryIssueFilters ++= Seq(
),
BuildInfoPlugin.buildInfoDefaultSettings, // avoids BuildInfo generated in Compile scope
addBuildInfoToConfig(Test),
Test / buildInfoKeys := Seq[BuildInfoKey](target),
Test / buildInfoPackage := "sbt.internal.io",
Test / buildInfoUsePackageAsPath := true,
)