Skip to content

Commit

Permalink
unusedCompileDependenciesFilter scala-js and scala-native
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsBroersen committed Nov 16, 2024
1 parent 6f4cdd4 commit 6278bc7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 31 deletions.
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.10.2
sbt.version = 1.10.5
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1")

// Versioning and Release Plugins
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0")

// Docs Plugins
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.6.1")
Expand Down
4 changes: 2 additions & 2 deletions zio-sbt-ecosystem/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1")

// Versioning and Release Plugins
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0")

// Docs Plugins
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.6.1")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")

// Binary Compatibility Plugin
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4")

libraryDependencies += "dev.zio" %% "zio" % "2.1.11"
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,7 @@ trait ScalaCompilerSettings {
},
Test / parallelExecution := scalaBinaryVersion.value != "3", // why not parallel execution for Scala 3?
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
unusedCompileDependenciesFilter -= moduleFilter(
"org.scala-js",
"scalajs-library"
) // why does it need to be filtered out?
autoAPIMappings := true
) ++ (if (enableCrossProject) crossProjectSettings else Seq.empty) ++ {
packageName match {
case Some(name) => buildInfoSettings(name)
Expand Down Expand Up @@ -294,7 +290,8 @@ trait ScalaCompilerSettings {
.requireJS(
false
)
.value
.value,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js")
)

def jvmSettings: Seq[Setting[_]] = Seq(
Expand All @@ -312,7 +309,8 @@ trait ScalaCompilerSettings {
)
.value,
doc / skip := BuildAssertions.requireNative(true).value,
Compile / doc / sources := BuildAssertions.requireNative(Seq.empty).value
Compile / doc / sources := BuildAssertions.requireNative(Seq.empty).value,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-native")
// Test / test := { val _ = (Test / compile).value; () } // ??
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object Branch {
case object All extends Branch
case class Named(name: String) extends Branch

implicit val codec: JsonCodec[Branch] = JsonCodec.string.transform(
implicit lazy val codec: JsonCodec[Branch] = JsonCodec.string.transform(
{
case "*" => All
case name => Named(name)
Expand All @@ -64,15 +64,15 @@ case class Triggers(

object Triggers {

implicit val codec: JsonCodec[Triggers] = DeriveJsonCodec.gen[Triggers]
implicit lazy val codec: JsonCodec[Triggers] = DeriveJsonCodec.gen[Triggers]
}

sealed trait Trigger

object Trigger {
case class InputValue(description: String, required: Boolean, default: String)
object InputValue {
implicit val jsonCodec: JsonCodec[InputValue] = DeriveJsonCodec.gen[InputValue]
implicit lazy val jsonCodec: JsonCodec[InputValue] = DeriveJsonCodec.gen[InputValue]
}

case class WorkflowDispatch(
Expand All @@ -86,15 +86,15 @@ object Trigger {
JsonDecoder.keyValueChunk[K, V].map(c => ListMap(c: _*))
)

implicit val jsonCodec: JsonCodec[WorkflowDispatch] = DeriveJsonCodec.gen[WorkflowDispatch]
implicit lazy val jsonCodec: JsonCodec[WorkflowDispatch] = DeriveJsonCodec.gen[WorkflowDispatch]
}

case class Release(
types: Seq[ReleaseType] = Seq.empty
) extends Trigger

object Release {
implicit val jsonCodec: JsonCodec[Release] = DeriveJsonCodec.gen[Release]
implicit lazy val jsonCodec: JsonCodec[Release] = DeriveJsonCodec.gen[Release]
}

sealed trait ReleaseType
Expand All @@ -103,7 +103,7 @@ object Trigger {
case object Published extends ReleaseType
case object Prereleased extends ReleaseType

implicit val codec: JsonCodec[ReleaseType] = JsonCodec.string.transformOrFail(
implicit lazy val codec: JsonCodec[ReleaseType] = JsonCodec.string.transformOrFail(
{
case "created" => Right(Created)
case "published" => Right(Published)
Expand All @@ -127,7 +127,7 @@ object Trigger {
) extends Trigger

object PullRequest {
implicit val jsonCodec: JsonCodec[PullRequest] = DeriveJsonCodec.gen[PullRequest]
implicit lazy val jsonCodec: JsonCodec[PullRequest] = DeriveJsonCodec.gen[PullRequest]
}

case class Push(
Expand All @@ -136,7 +136,7 @@ object Trigger {
) extends Trigger

object Push {
implicit val jsonCodec: JsonCodec[Push] = DeriveJsonCodec.gen[Push]
implicit lazy val jsonCodec: JsonCodec[Push] = DeriveJsonCodec.gen[Push]
}

case class Create(
Expand All @@ -145,7 +145,7 @@ object Trigger {
) extends Trigger

object Create {
implicit val jsonCodec: JsonCodec[Create] = DeriveJsonCodec.gen[Create]
implicit lazy val jsonCodec: JsonCodec[Create] = DeriveJsonCodec.gen[Create]
}
}

Expand All @@ -155,12 +155,12 @@ case class Strategy(matrix: ListMap[String, List[String]], maxParallel: Option[I
object Strategy {
import Workflow.listMapCodec

implicit val codec: JsonCodec[Strategy] = DeriveJsonCodec.gen[Strategy]
implicit lazy val codec: JsonCodec[Strategy] = DeriveJsonCodec.gen[Strategy]
}

case class ActionRef(ref: String)
object ActionRef {
implicit val codec: JsonCodec[ActionRef] = JsonCodec.string.transform(ActionRef(_), _.ref)
implicit lazy val codec: JsonCodec[ActionRef] = JsonCodec.string.transform(ActionRef(_), _.ref)
}

sealed trait Condition {
Expand Down Expand Up @@ -191,7 +191,7 @@ object Condition {
}

object Expression {
implicit val codec: JsonCodec[Expression] = JsonCodec.string.transform(Expression(_), _.asString)
implicit lazy val codec: JsonCodec[Expression] = JsonCodec.string.transform(Expression(_), _.asString)
}

case class Function(expression: String) extends Condition {
Expand All @@ -205,10 +205,10 @@ object Condition {
}

object Function {
implicit val codec: JsonCodec[Function] = JsonCodec.string.transform(Function(_), _.expression)
implicit lazy val codec: JsonCodec[Function] = JsonCodec.string.transform(Function(_), _.expression)
}

implicit val codec: JsonCodec[Condition] = JsonCodec.string.transform(
implicit lazy val codec: JsonCodec[Condition] = JsonCodec.string.transform(
{
case expression if expression.startsWith("${{") => Expression(expression)
case expression => Function(expression)
Expand Down Expand Up @@ -251,17 +251,17 @@ object Step {
steps.flatMap(_.flatten)
}

implicit val codec: JsonCodec[Step] = DeriveJsonCodec.gen[Step]
implicit lazy val codec: JsonCodec[Step] = DeriveJsonCodec.gen[Step]
}

case class ImageRef(ref: String)
object ImageRef {
implicit val codec: JsonCodec[ImageRef] = JsonCodec.string.transform(ImageRef(_), _.ref)
implicit lazy val codec: JsonCodec[ImageRef] = JsonCodec.string.transform(ImageRef(_), _.ref)
}

case class ServicePort(inner: Int, outer: Int)
object ServicePort {
implicit val codec: JsonCodec[ServicePort] = JsonCodec.string.transformOrFail(
implicit lazy val codec: JsonCodec[ServicePort] = JsonCodec.string.transformOrFail(
v =>
Try(v.split(":", 2).map(_.toInt).toList) match {
case Success(inner :: outer :: Nil) => Right(ServicePort(inner.toInt, outer.toInt))
Expand All @@ -279,7 +279,7 @@ case class Service(
ports: Option[Seq[ServicePort]] = None
)
object Service {
implicit val codec: JsonCodec[Service] = DeriveJsonCodec.gen[Service]
implicit lazy val codec: JsonCodec[Service] = DeriveJsonCodec.gen[Service]
}

@jsonMemberNames(KebabCase)
Expand Down Expand Up @@ -340,7 +340,7 @@ case class Concurrency(
)

object Concurrency {
implicit val codec: JsonCodec[Concurrency] = DeriveJsonCodec.gen[Concurrency]
implicit lazy val codec: JsonCodec[Concurrency] = DeriveJsonCodec.gen[Concurrency]
}

case class Workflow(
Expand Down Expand Up @@ -372,5 +372,5 @@ object Workflow {
JsonEncoder.keyValueIterable[K, V, ListMap],
JsonDecoder.keyValueChunk[K, V].map(c => ListMap(c: _*))
)
implicit val codec: JsonCodec[Workflow] = DeriveJsonCodec.gen[Workflow]
implicit lazy val codec: JsonCodec[Workflow] = DeriveJsonCodec.gen[Workflow]
}

0 comments on commit 6278bc7

Please sign in to comment.