forked from zio/interop-cats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
2,627 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import sbtcrossproject.CrossPlugin.autoImport.crossProject | ||
import explicitdeps.ExplicitDepsPlugin.autoImport.moduleFilterRemoveValue | ||
import ScalazBuild._ | ||
|
||
inThisBuild( | ||
List( | ||
organization := "dev.zio", | ||
homepage := Some(url("https://zio.dev")), | ||
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), | ||
developers := List( | ||
Developer( | ||
"jdegoes", | ||
"John De Goes", | ||
"[email protected]", | ||
url("http://degoes.net") | ||
) | ||
) | ||
) | ||
) | ||
|
||
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt") | ||
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck") | ||
addCommandAlias("testJVM", ";interopCatsJVM/test") | ||
addCommandAlias("testJS", ";interopCatsJS/test") | ||
|
||
pgpPublicRing := file("/tmp/public.asc") | ||
pgpSecretRing := file("/tmp/secret.asc") | ||
releaseEarlyWith := SonatypePublisher | ||
scmInfo := Some( | ||
ScmInfo(url("https://github.com/zio/interop-cats/"), "scm:git:[email protected]:zio/interop-cats.git") | ||
) | ||
|
||
lazy val root = project | ||
.in(file(".")) | ||
.enablePlugins(ScalaJSPlugin) | ||
.aggregate(interopCatsJVM, interopCatsJS) | ||
.settings( | ||
skip in publish := true, | ||
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library") | ||
) | ||
|
||
lazy val interopCats = crossProject(JSPlatform, JVMPlatform) | ||
.in(file("interop-cats")) | ||
.enablePlugins(BuildInfoPlugin) | ||
.settings(stdSettings("zio-interop-cats")) | ||
.settings(buildInfoSettings) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"dev.zio" %%% "scalaz-zio" % "1.0-RC6", | ||
"org.typelevel" %%% "cats-effect" % "1.3.1" % Optional, | ||
"org.typelevel" %%% "cats-mtl-core" % "0.5.0" % Optional, | ||
"co.fs2" %%% "fs2-core" % "1.0.4" % Test, | ||
"org.specs2" %%% "specs2-core" % "4.5.1" % Test, | ||
"org.specs2" %%% "specs2-scalacheck" % "4.5.1" % Test, | ||
"org.specs2" %%% "specs2-matcher-extra" % "4.5.1" % Test | ||
) | ||
) | ||
|
||
val CatsScalaCheckVersion = Def.setting { | ||
CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, v)) if v <= 12 => | ||
"1.13" | ||
case _ => | ||
"1.14" | ||
} | ||
} | ||
|
||
val ScalaCheckVersion = Def.setting { | ||
CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, v)) if v <= 12 => | ||
"1.13.5" | ||
case _ => | ||
"1.14.0" | ||
} | ||
} | ||
|
||
def majorMinor(version: String) = version.split('.').take(2).mkString(".") | ||
|
||
val CatsScalaCheckShapelessVersion = Def.setting { | ||
CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, v)) if v <= 12 => | ||
"1.1.8" | ||
case _ => | ||
"1.2.0-1+7-a4ed6f38-SNAPSHOT" // TODO: Stable version | ||
} | ||
} | ||
|
||
// Below is for the cats law spec | ||
// Separated due to binary incompatibility in scalacheck 1.13 vs 1.14 | ||
// TODO remove it when https://github.com/typelevel/discipline/issues/52 is closed | ||
lazy val interopCatsJVM = interopCats.jvm | ||
.settings( | ||
resolvers += Resolver | ||
.sonatypeRepo("snapshots"), // TODO: Remove once scalacheck-shapeless has a stable version for 2.13.0-M5 | ||
libraryDependencies ++= Seq( | ||
"org.typelevel" %% "cats-effect-laws" % "1.3.1" % Test, | ||
"org.typelevel" %% "cats-testkit" % "1.6.1" % Test, | ||
"org.typelevel" %% "cats-mtl-laws" % "0.5.0" % Test, | ||
"com.github.alexarchambault" %% s"scalacheck-shapeless_${majorMinor(CatsScalaCheckVersion.value)}" % CatsScalaCheckShapelessVersion.value % Test | ||
), | ||
dependencyOverrides += "org.scalacheck" %% "scalacheck" % ScalaCheckVersion.value % Test | ||
) | ||
|
||
lazy val interopCatsJS = interopCats.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright 2017-2019 John A. De Goes and the ZIO Contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package zio.interop | ||
|
||
abstract class CatsPlatform {} | ||
|
||
abstract class CatsMtlPlatform {} |
Oops, something went wrong.