Skip to content

Commit

Permalink
Merge pull request #564 from goshacodes/fix_publish
Browse files Browse the repository at this point in the history
fix publish zio and cats-effect
  • Loading branch information
goshacodes authored Jan 9, 2025
2 parents fe6d823 + 2339acc commit 1e2edde
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Native Scala mocking.
Official website: [scalamock.org](https://scalamock.org/)


## Scala 3 new API (since 7.0.0)
## Scala 3 new API (since 7.0.1)
Scalamock internals and new API relies on Scala 3 experimental API, so prerequisites are:
```scala
scalaVersion := "3.4.2" // or higher
Expand All @@ -17,11 +17,11 @@ Test / scalacOptions += "-experimental"
```scala
libraryDependencies ++= Seq(
// core module
"org.scalamock" %% "scalamock" % "7.0.0",
"org.scalamock" %% "scalamock" % "7.0.1",
// zio integration
"org.scalamock" %% "scalamock-zio" % "7.0.0",
"org.scalamock" %% "scalamock-zio" % "7.0.1",
// cats-effect integration
"org.scalamock" %% "scalamock-cats-effect" % "7.0.0"
"org.scalamock" %% "scalamock-cats-effect" % "7.0.1"
)
```

Expand Down
41 changes: 23 additions & 18 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@ lazy val root = project.in(file("."))
.aggregate(
scalamock.jvm,
scalamock.js,
zio.jvm,
zio.js,
`cats-effect`.jvm,
`cats-effect`.js
`scalamock-zio`.jvm,
`scalamock-zio`.js,
`scalamock-cats-effect`.jvm,
`scalamock-cats-effect`.js
)

lazy val scalamock = crossProject(JSPlatform, JVMPlatform)
.in(file("core"))
.settings(
commonSettings,
name := "scalamock",
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := true,
Compile / packageSrc / publishArtifact := true,
Test / publishArtifact := false,
Compile / doc / scalacOptions ++= Opts.doc.title("ScalaMock") ++
Opts.doc.version(version.value) ++ Seq("-doc-root-content", "rootdoc.txt", "-version"),
libraryDependencies ++= Seq(
Expand All @@ -43,15 +39,11 @@ lazy val scalamock = crossProject(JSPlatform, JVMPlatform)
),
)

lazy val zio = crossProject(JSPlatform, JVMPlatform)
lazy val `scalamock-zio` = crossProject(JSPlatform, JVMPlatform)
.in(file("zio"))
.settings(
name := "scalamock-zio",
commonSettings,
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := true,
Compile / packageSrc / publishArtifact := true,
Test / publishArtifact := false,
libraryDependencies ++= {
val zioVersion = "2.1.14"
Seq(
Expand All @@ -63,22 +55,35 @@ lazy val zio = crossProject(JSPlatform, JVMPlatform)
)
.dependsOn(scalamock)

lazy val `cats-effect` = crossProject(JSPlatform, JVMPlatform)

lazy val `scalamock-cats-effect` = crossProject(JSPlatform, JVMPlatform)
.in(file("cats-effect"))
.settings(
name := "scalamock-cats-effect",
commonSettings,
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := true,
Compile / packageSrc / publishArtifact := true,
Test / publishArtifact := false,
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect" % "3.5.7",
"org.typelevel" %% "munit-cats-effect" % "2.0.0" % Test
)
)
.dependsOn(scalamock)

lazy val `scalamock-zio-jvm` = `scalamock-zio`.jvm.settings(
name := "scalamock-zio"
)

lazy val `scalamock-zio-js` = `scalamock-zio`.js.settings(
name := "scalamock-zio"
)

lazy val `scalamock-cats-effect-jvm` = `scalamock-cats-effect`.jvm.settings(
name := "scalamock-cats-effect"
)

lazy val `scalamock-cats-effect-js` = `scalamock-cats-effect`.js.settings(
name := "scalamock-cats-effect"
)

lazy val examples = project in file("core/examples") settings(
commonSettings,
name := "ScalaMock Examples",
Expand Down
6 changes: 3 additions & 3 deletions core/shared/src/main/scala/org/scalamock/stubs/Stubs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import java.util.concurrent.atomic.AtomicReference
import scala.quoted.{Expr, Quotes, Type}
import scala.util.{NotGiven, TupledFunction}

/** Indicates that object of type [[T]] was generated */
/** Indicates that object of type T was generated */
opaque type Stub[+T] <: T = T

trait Stubs:
Expand All @@ -18,7 +18,7 @@ trait Stubs:
*/
final def resetStubs(): Unit = stubs.clearAll()

/** Generates an object of type [[T]] with possibility to record methods arguments and set-up method results */
/** Generates an object of type T with possibility to record methods arguments and set-up method results */
inline def stub[T]: Stub[T] = stubImpl[T]

extension [F](inline f: F)
Expand Down Expand Up @@ -136,7 +136,7 @@ trait Stubs:
* foo.foo2(1, 1)
*
* foo.foo1.times(1) // 0
* foo.foo1.times(2) // 2
* foo.foo1.times(3) // 2
* foo.foo2.times((1, 1)) // 1
* }}}
*/
Expand Down

0 comments on commit 1e2edde

Please sign in to comment.