Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'sbt'
- uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14
- uses: sbt/setup-sbt@ce95da69b39609ea153bad087708da5f37366897 # v1, specifically v1.5.10
- name: Check formatting
run: sbt -v scalafmtCheckAll
- name: Compile
run: sbt -v compile
- name: Compile documentation
run: sbt -v compileDocumentation
- name: Test
run: sbt -v test
run: sbt -v testFull
- uses: actions/upload-artifact@v4 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
Expand Down Expand Up @@ -65,4 +65,4 @@ jobs:
if: github.event.pull_request.user.login == 'softwaremill-ci'
needs: [ ci, label, mima ]
uses: softwaremill/github-actions-workflows/.github/workflows/auto-merge.yml@main
secrets: inherit
secrets: inherit
8 changes: 7 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ rewrite.scala3 {
convertToNewSyntax = true
removeOptionalBraces.enabled = true
insertEndMarkerMinLines = 8
}
}

fileOverride {
"glob:**.sbt" {
runner.dialect = scala3
}
}
58 changes: 26 additions & 32 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,27 @@ import com.softwaremill.Publish.{ossPublishSettings, updateDocs}
import com.softwaremill.UpdateVersionInDocs
import com.typesafe.tools.mima.core.{MissingClassProblem, ProblemFilters}

lazy val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
organization := "com.softwaremill.ox",
scalaVersion := "3.3.8",
scalacOptions ++= Seq("-Yfuture-lazy-vals", "-java-output-version", "21"),
updateDocs := Def.taskDyn {
val files1 = UpdateVersionInDocs(sLog.value, organization.value, version.value)
Def.task {
(documentation / mdoc).toTask("").value
files1 ++ Seq(file("generated-doc/out"))
}
}.value,
Test / scalacOptions += "-Wconf:msg=unused value of type org.scalatest.Assertion:s",
Test / scalacOptions += "-Wconf:msg=unused value of type org.scalatest.compatible.Assertion:s",
mimaPreviousArtifacts := Set.empty // we only use MiMa for `core` for now, using enableMimaSettings
)
commonSmlBuildSettings
ossPublishSettings

organization := "com.softwaremill.ox"
scalaVersion := "3.3.8"
scalacOptions ++= Seq("-Yfuture-lazy-vals", "-java-output-version", "21")
Test / scalacOptions += "-Wconf:msg=unused value of type org.scalatest.Assertion:s"
Test / scalacOptions += "-Wconf:msg=unused value of type org.scalatest.compatible.Assertion:s"
mimaPreviousArtifacts := Set.empty // we only use MiMa for `core` for now, using enableMimaSettings

val enableMimaSettings = Seq(
mimaPreviousArtifacts := {
val current = version.value
val isRcOrMilestone = current.contains("M") || current.contains("RC")
if (!isRcOrMilestone) {
if !isRcOrMilestone then
val previous = previousStableVersion.value
println(s"[info] Not a M or RC version, using previous version for MiMa check: $previous")
previousStableVersion.value.map(organization.value %% moduleName.value % _).toSet
} else {
else
println(s"[info] $current is an M or RC version, no previous version to check with MiMa")
Set.empty
}
},
mimaBinaryIssueFilters ++= Seq(
// GroupingTimeout is only ever used within the groupWithin method, never exposed externally
Expand All @@ -47,17 +40,23 @@ val jsoniterMacros = "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-

// used during CI to verify that the documentation compiles
val compileDocumentation: TaskKey[Unit] = taskKey[Unit]("Compiles documentation throwing away its output")
compileDocumentation := {
(documentation / mdoc).toTask(" --out target/ox-doc").value
}

lazy val rootProject = (project in file("."))
.settings(commonSettings)
.settings(publishArtifact := false, name := "ox")
.settings(
publishArtifact := false,
name := "ox",
updateDocs := Def.uncached(Def.taskDyn {
val files1 = UpdateVersionInDocs(sLog.value, organization.value, version.value)
Def.task {
(documentation / mdoc).toTask("").value
files1 ++ Seq(file("generated-doc/out"))
}
}.value),
compileDocumentation := (documentation / mdoc).toTask(" --out target/ox-doc").value
)
.aggregate(core, kafka, mdcLogback, flowReactiveStreams, flowJson, cron, otelContext)

lazy val core: Project = (project in file("core"))
.settings(commonSettings)
.settings(
name := "core",
libraryDependencies ++= Seq(
Expand All @@ -71,7 +70,6 @@ lazy val core: Project = (project in file("core"))
.settings(enableMimaSettings)

lazy val kafka: Project = (project in file("kafka"))
.settings(commonSettings)
.settings(
name := "kafka",
libraryDependencies ++= Seq(
Expand All @@ -82,12 +80,13 @@ lazy val kafka: Project = (project in file("kafka"))
"org.apache.pekko" %% "pekko-connectors-kafka" % "1.2.0" % Test,
"org.apache.pekko" %% "pekko-stream" % "1.7.0" % Test,
scalaTest
)
),
// in sbt 2's default (client) mode tests would hang in sbt 2.0.9
Test / fork := true
)
.dependsOn(core)

lazy val mdcLogback: Project = (project in file("mdc-logback"))
.settings(commonSettings)
.settings(
name := "mdc-logback",
libraryDependencies ++= Seq(
Expand All @@ -98,7 +97,6 @@ lazy val mdcLogback: Project = (project in file("mdc-logback"))
.dependsOn(core)

lazy val flowReactiveStreams: Project = (project in file("flow-reactive-streams"))
.settings(commonSettings)
.settings(
name := "flow-reactive-streams",
libraryDependencies ++= Seq(
Expand All @@ -109,7 +107,6 @@ lazy val flowReactiveStreams: Project = (project in file("flow-reactive-streams"
.dependsOn(core)

lazy val flowJson: Project = (project in file("flow-json"))
.settings(commonSettings)
.settings(
name := "flow-json",
libraryDependencies ++= Seq(
Expand All @@ -121,7 +118,6 @@ lazy val flowJson: Project = (project in file("flow-json"))
.dependsOn(core)

lazy val cron: Project = (project in file("cron"))
.settings(commonSettings)
.settings(
name := "cron",
libraryDependencies ++= Seq(
Expand All @@ -132,7 +128,6 @@ lazy val cron: Project = (project in file("cron"))
.dependsOn(core % "test->test;compile->compile")

lazy val otelContext: Project = (project in file("otel-context"))
.settings(commonSettings)
.settings(
name := "otel-context",
libraryDependencies ++= Seq(
Expand All @@ -144,7 +139,6 @@ lazy val otelContext: Project = (project in file("otel-context"))

lazy val documentation: Project = (project in file("generated-doc")) // important: it must not be doc/
.enablePlugins(MdocPlugin)
.settings(commonSettings)
.settings(
mdocIn := file("doc"),
moduleName := "ox-doc",
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/ox/flow/FlowCompanionIOOpsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class FlowCompanionIOOpsTest extends AnyWordSpec with Matchers:
assertThrows[NoSuchFileException](Flow.fromFile(path).runToList())

"throw an exception if path is a directory" in supervised:
val path = Paths.get(getClass.getResource("/").toURI)
val path = Files.createTempDirectory("ox-test")
val exception = intercept[IOException](Flow.fromFile(path).runToList())
exception.getMessage should endWith("is a directory")

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/ox/flow/FlowIOOpsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class FlowIOOpsTest extends AnyWordSpec with Matchers:
exception.getMessage shouldBe "expected source error"

"throw an exception if path is a directory" in:
val path = Paths.get(getClass.getResource("/").toURI)
val path = Files.createTempDirectory("ox-test")
val source = Flow.fromValues(Chunk.empty[Byte])
val exception = intercept[IOException](source.runToFile(path))
exception.getMessage should endWith("is a directory")
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.13.0
sbt.version=2.0.9
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
val sbtSoftwareMillVersion = "2.1.2"
val sbtSoftwareMillVersion = "3.0.1"
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % sbtSoftwareMillVersion)
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % sbtSoftwareMillVersion)
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.9.2")
Expand Down
Loading