Skip to content

Commit c16ad7b

Browse files
committed
sbt 2
1 parent 01a1e0f commit c16ad7b

4 files changed

Lines changed: 21 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
java:
15-
- 11
15+
- 17
1616
- 25
1717
steps:
1818
- uses: actions/checkout@v6

build.sbt

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ val isScala3 = Def.setting(
1111
CrossVersion.partialVersion(scalaVersion.value).exists(_._1 == 3)
1212
)
1313

14-
def gitHash(): String = sys.process.Process("git rev-parse HEAD").lineStream_!.head
14+
def gitHash(): String = sys.process.Process("git rev-parse HEAD").lazyLines_!.head
1515

1616
val tagName = Def.setting {
1717
s"v${if (releaseUseGlobalVersion.value) (ThisBuild / version).value
@@ -21,18 +21,6 @@ val tagOrHash = Def.setting {
2121
if (isSnapshot.value) gitHash() else tagName.value
2222
}
2323

24-
val runAll = TaskKey[Unit]("runAll")
25-
26-
def runAllIn(config: Configuration): Setting[Task[Unit]] = {
27-
(config / runAll) := {
28-
val classes = (config / discoveredMainClasses).value
29-
val runner0 = (run / runner).value
30-
val cp = (config / fullClasspath).value
31-
val s = streams.value
32-
classes.foreach(c => runner0.run(c, Attributed.data(cp), Seq(), s.log))
33-
}
34-
}
35-
3624
val commonSettings = Def.settings(
3725
scalapropsCoreSettings,
3826
scalapropsVersion := "0.11.0",
@@ -125,15 +113,15 @@ val commonSettings = Def.settings(
125113
}
126114
},
127115
libraryDependencies ++= List(
128-
"com.github.scalaprops" %%% "scalaprops" % scalapropsVersion.value % "test",
129-
"org.scalaz" %%% "scalaz-core" % "7.3.9"
116+
"com.github.scalaprops" %% "scalaprops" % scalapropsVersion.value % "test",
117+
"org.scalaz" %% "scalaz-core" % "7.3.9"
130118
),
131119
libraryDependencies ++= {
132120
if (isScala3.value) {
133121
Nil
134122
} else {
135123
Seq(
136-
compilerPlugin("org.typelevel" % "kind-projector" % "0.13.4" cross CrossVersion.full)
124+
compilerPlugin(("org.typelevel" % "kind-projector" % "0.13.4").cross(CrossVersion.full))
137125
)
138126
}
139127
}
@@ -203,24 +191,24 @@ val example = projectMatrix
203191
)
204192
.settings(
205193
commonSettings,
206-
runAllIn(Compile),
207194
noPublish
208195
)
209196
.dependsOn(
210197
optparseApplicative
211198
)
212199

213-
commonSettings
214-
noPublish
215-
216-
TaskKey[Unit]("testSequential") := Def
217-
.sequential(
218-
(optparseApplicative.projectRefs ++ example.projectRefs).map { x =>
219-
Def.sequential(
220-
Def.task(streams.value.log.info(s"start ${(x / thisProject).value.id} test")),
221-
x / Test / test,
222-
Def.task(streams.value.log.info(s"end ${(x / thisProject).value.id} test"))
223-
)
224-
}
225-
)
226-
.value
200+
val optparseApplicativeRoot = rootProject.autoAggregate.settings(
201+
commonSettings,
202+
noPublish,
203+
TaskKey[Unit]("testSequential") := Def
204+
.sequential(
205+
(optparseApplicative.projectRefs ++ example.projectRefs).map { x =>
206+
Def.sequential(
207+
Def.task(streams.value.log.info(s"start ${(x / thisProject).value.id} test")),
208+
x / Test / testFull,
209+
Def.task(streams.value.log.info(s"end ${(x / thisProject).value.id} test"))
210+
)
211+
}
212+
)
213+
.value
214+
)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.12.12
1+
sbt.version=2.0.0

project/plugins.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.1")
22
addSbtPlugin("com.github.scalaprops" % "sbt-scalaprops" % "0.5.3")
3-
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.11.0")
43
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.22.0")
54
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.12")
65
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")

0 commit comments

Comments
 (0)