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
79 changes: 42 additions & 37 deletions build.mill.scala
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ object snunit extends Common.Native with Publish {
}
}

// object `snunit-async-cats-effect` extends Common.Native with Publish {
// def moduleDeps = Seq(snunit)
object `snunit-async-cats-effect` extends Common.Native with Publish {
def moduleDeps = Seq(snunit)

// def ivyDeps =
// Task {
// super.ivyDeps() ++ Agg(
// ivy"org.typelevel::cats-effect::${Versions.catsEffect}"
// )
// }
// }
def ivyDeps =
Task {
super.ivyDeps() ++ Agg(
ivy"org.typelevel::cats-effect::${Versions.catsEffect}"
)
}
}

object `snunit-undertow` extends Common.Native with Publish {
def moduleDeps = Seq(snunit)
Expand All @@ -127,35 +127,40 @@ object `snunit-tapir` extends Common.Native with Publish {
def moduleDeps = Seq(snunit)
def ivyDeps = super.ivyDeps() ++ Agg(ivy"com.softwaremill.sttp.tapir::tapir-server::${Versions.tapir}")
}
// object `snunit-tapir-cats-effect` extends Common.Native with Publish {
// def moduleDeps = Seq(
// `snunit-tapir`,
// `snunit-async-cats-effect`
// )
// def ivyDeps = super.ivyDeps() ++ Agg(
// ivy"com.softwaremill.sttp.tapir::tapir-cats-effect::${Versions.tapir}"
// )
// }
object `snunit-tapir-cats-effect` extends Common.Native with Publish {
def moduleDeps = Seq(
`snunit-tapir`,
`snunit-async-cats-effect`
)
def ivyDeps = super.ivyDeps() ++ Agg(
ivy"com.softwaremill.sttp.tapir::tapir-cats-effect::${Versions.tapir}"
)
}

// object `snunit-http4s` extends Cross[SNUnitHttp4s]
// trait SNUnitHttp4s extends Common.Native with Cross.Module[String] with Publish {
// val http4sVersion = crossValue
// def moduleDeps = Seq(
// snunit,
// `snunit-async-cats-effect`
// )
// val http4sBinaryVersion = http4sVersion match {
// case s"0.23.$_" => "0.23"
// case s"1.$_" => "1"
// }
// def artifactName = s"snunit-http4s$http4sBinaryVersion"
// def ivyDeps = super.ivyDeps() ++ Agg(
// ivy"org.http4s::http4s-server::$http4sVersion"
// )
// def sources = T.sources {
// super.sources() ++ Agg(PathRef(millSourcePath / s"http4s-$http4sBinaryVersion" / "src"))
// }
// }
object `snunit-http4s` extends Common.Native with Publish {
val http4sVersion = Versions.http4s023
def moduleDeps = Seq(
snunit,
`snunit-async-cats-effect`
)
val http4sBinaryVersion = http4sVersion match {
case s"0.23.$_" => "0.23"
case s"1.$_" => "1"
}
def artifactName = s"snunit-http4s$http4sBinaryVersion"
def ivyDeps = super.ivyDeps() ++ Agg(
ivy"org.http4s::http4s-server::$http4sVersion"
)
def sources = T.sources {
super.sources() ++ Agg(PathRef(millSourcePath / s"http4s-$http4sBinaryVersion" / "src"))
}

def repositoriesTask = Task.Anon {
super.repositoriesTask() ++ Seq(
coursier.MavenRepository("https://central.sonatype.com/repository/maven-snapshots/")
)
}
}

def caskSources = Task {
val dest = Task.dest
Expand Down
12 changes: 9 additions & 3 deletions snunit-async-cats-effect/src/snunit/CEAsyncServerBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ private[snunit] object CEAsyncServerBuilder {
)
)

def stop(): Unit = {
def stop(): Unit = this.synchronized {
stopped = true
PortData.stopped.put(this, ())
PortData.stop(this)

}
}

Expand All @@ -139,9 +140,14 @@ private[snunit] object CEAsyncServerBuilder {

def isLastFDStopped: Boolean = references == stopped

def stop(pd: PortData): Unit =
this.synchronized:
PortData.stopped.put(pd, ())

def register(ctx: nxt_unit_ctx_t_*, port: nxt_unit_port_t_*): Unit =
val portData = new PortData(ctx, port)
references.put(portData, ())
this.synchronized:
references.put(portData, ())
port.data = fromRawPtr(Intrinsics.castObjectToRawPtr(portData))

def fromPort(port: nxt_unit_port_t_*): PortData = {
Expand Down
10 changes: 5 additions & 5 deletions versions.mill.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package build
// This file is system-linked in sbt-plugin/project/Versions.scala
// It needs to be a valid Scala file so we can't use top level `val`s
object Versions {
val scalaNative = "0.5.7"
val scalaNative = "0.5.8"
val upickle = "4.0.2"
val undertow = "2.3.18.Final"
val scala212 = "2.12.19"
val scala3 = "3.3.4"
val tapir = "1.11.1"
val scala3 = "3.3.6"
val tapir = "1.11.44"
val cask = "0.10.2"
val catsEffect = "3.6-623178c"
val http4s023 = "0.23.26"
val catsEffect = "3.7.0-RC1"
val http4s023 = "0.23.30-161-f5b9629-SNAPSHOT"
val http4s1 = "1.0.0-M41"
val mill011 = "0.11.13"
val utest = "0.8.4"
Expand Down