-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sbt
104 lines (91 loc) · 2.79 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
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
ThisBuild / name := "futiles"
ThisBuild / organization := "com.markatta"
ThisBuild / crossScalaVersions := Seq("2.12.18", "2.13.12")
ThisBuild / scalaVersion := crossScalaVersions.value.last
val flagsFor11 = Seq(
"-Xlint:_",
"-feature",
"-deprecation",
"-Yconst-opt",
"-Ywarn-infer-any",
"-Yclosure-elim",
"-Ydead-code"
)
val flagsFor12 = Seq(
"-Xlint:_",
"-feature",
"-deprecation",
"-Ywarn-infer-any",
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-opt-inline-from:<sources>",
"-opt:l:method"
)
val flagsFor13 = Seq(
"-Xlint:_",
"-feature",
"-deprecation",
"-opt-inline-from:<sources>",
"-opt:l:method"
)
ThisBuild / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n == 13 =>
flagsFor13
case Some((2, n)) if n == 12 =>
flagsFor12
case Some((2, n)) if n == 11 =>
flagsFor11
}
}
libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % "3.0.8" % "test")
// releasing
releaseCrossBuild := true
licenses := Seq(
"Apache License, Version 2.0" -> url(
"http://www.apache.org/licenses/LICENSE-2.0"
)
)
homepage := Some(url("https://github.com/johanandren/futiles"))
Test / publishArtifact := false
pomIncludeRepository := { _ => false }
scmInfo := Some(
ScmInfo(url("https://github.com/johanandren/futiles"), "[email protected]:johanandren/futiles.git")
)
developers := List(
Developer("johanandren", "Johan Andrén", "[email protected]", url("https://markatta.com/johan/codemonkey"))
)
ThisBuild / githubWorkflowJavaVersions := List(
JavaSpec.temurin("11"),
JavaSpec.temurin("17")
)
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches :=
Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("clean", "coverage", "test"), name = Some("Build project"))
)
ThisBuild / githubWorkflowBuildPostamble ++= Seq(
// See https://github.com/scoverage/sbt-coveralls#github-actions-integration
WorkflowStep.Sbt(
List("coverageReport", "coverageAggregate", "coveralls"),
name = Some("Upload coverage data to Coveralls"),
env = Map(
"COVERALLS_REPO_TOKEN" -> "${{ secrets.GITHUB_TOKEN }}",
"COVERALLS_FLAG_NAME" -> "Scala ${{ matrix.scala }}"
)
)
)