-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sbt
More file actions
135 lines (124 loc) · 3.94 KB
/
build.sbt
File metadata and controls
135 lines (124 loc) · 3.94 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import org.typelevel.sbt.gha.JavaSpec.Distribution
import xerial.sbt.Sonatype.sonatypeCentralHost
import scoverage.ScoverageKeys._
disablePlugins(TypelevelMimaPlugin) // we use our own versioning for now via gitflow-packager
lazy val isCI = sys.env.get("CI").contains("true")
inThisBuild(List(
organization := "co.blocke",
homepage := Some(url("https://github.com/gzoller/scala-reflection")),
licenses := List("MIT" -> url("https://opensource.org/licenses/MIT")),
developers := List(
Developer(
"gzoller",
"Greg Zoller",
"gzoller@blocke.co",
url("http://www.blocke.co")
),
Developer(
"pjfanning",
"PJ Fanning",
"",
url("https://github.com/pjfanning")
)
)
))
name := "scala-reflection"
ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/gzoller/scala-reflection"),
"scm:git@github.com:gzoller/scala-reflection.git"
)
)
ThisBuild / organization := "co.blocke"
ThisBuild / scalaVersion := "3.5.2"
ThisBuild / githubWorkflowScalaVersions := Seq("3.5.2")
lazy val root = project
.in(file("."))
.settings(settings)
.settings(
name := "reflection_library",
Compile / packageBin / mappings += {
(baseDirectory.value / "plugin.properties") -> "plugin.properties"
},
doc := null, // disable dottydoc for now
Compile / doc / sources := Seq(),
//sources in (Compile, doc) := Seq(),
Test / parallelExecution := false,
scalafmtOnCompile := !isCI,
libraryDependencies ++= Seq(
"org.scala-lang" %% "scala3-compiler" % scalaVersion.value,
"org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value,
"org.scala-lang" %% "scala3-staging" % scalaVersion.value,
"io.github.kitlangton" %% "neotype" % "0.2.4",
"org.scalameta" %% "munit" % "1.0.0-M9" % Test,
"co.blocke" %% "listzipper" % "0.1.6" % Test
)
)
ThisBuild / sonatypeCredentialHost := sonatypeCentralHost
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.Equals(Ref.Branch("main")),
RefPredicate.StartsWith(Ref.Tag("v"))
)
ThisBuild / githubWorkflowScalaVersions := Seq("3.5.2")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec(Distribution.Temurin, "21"))
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "windows-latest")
ThisBuild / githubWorkflowJobSetup := Seq(
WorkflowStep.Run(
name = Some("Ignore line ending differences in git"),
cond = Some("contains(runner.os, 'windows')"),
commands = List("bash -c 'git config --global core.autocrlf false'")
),
WorkflowStep.Use(
UseRef.Public("actions", "setup-java", "v4"),
params = Map(
"distribution" -> "temurin",
"java-version" -> "21"
)
),
WorkflowStep.Use(
UseRef.Public("actions", "checkout", "v4")
),
WorkflowStep.Use(
UseRef.Public("coursier", "setup-action", "v1")
),
WorkflowStep.Run(
name = Some("Install sbt"),
commands = List(
"cs install sbt",
"echo \"$HOME/.local/share/coursier/bin\" >> $GITHUB_PATH",
"sbt sbtVersion"
)
)
)
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 }}",
"CI_SNAPSHOT_RELEASE" -> "+publishSigned"
)
)
)
//==========================
// Settings
//==========================
lazy val settings = Seq(
javacOptions ++= Seq("--release", "21"),
scalacOptions ++= compilerOptions,
scalacOptions := scalacOptions.value.distinct,
testFrameworks += new TestFramework("munit.Framework")
)
lazy val compilerOptions = Seq(
"-unchecked",
"-feature",
"-language:implicitConversions",
"-deprecation",
// "-explain",
// "-experimental",
"-encoding",
"utf8"
)