Skip to content

Commit

Permalink
Add Dependencies object
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-adam committed Sep 15, 2023
1 parent 8c98862 commit f671e3e
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 69 deletions.
75 changes: 10 additions & 65 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ThisBuild / tlBaseVersion := "1.6"

ThisBuild / developers := List(tlGitHubDev("kamil-adam", "Kamil Adam"))

ThisBuild / crossScalaVersions := Seq("3.3.0")
ThisBuild / crossScalaVersions := Seq(Dependencies.scalaVersion)
ThisBuild / tlVersionIntroduced := Map("3" -> "1.1.5")

ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))
Expand All @@ -13,73 +13,18 @@ ThisBuild / tlJdkRelease := Some(8)
ThisBuild / tlSonatypeUseLegacyHost := false
ThisBuild / tlCiReleaseTags := false

val catsVersion = "2.9.0"
val catsEffectVersion = "3.5.1"
val catsMtlVersion = "1.3.1"
val fs2Version = "3.8.0"
//val spec2Version = "4.20.2"
val spec2Version = "4.19.2"
val jawnVersion = "1.5.1"
val scalaTestVersion = "3.2.16"

lazy val coreSettings = Seq(
name := "catculator",
moduleName := "catculator-core",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-kernel" % catsVersion,
"org.typelevel" %%% "cats-core" % catsVersion,
"org.typelevel" %%% "cats-laws" % catsVersion,
"org.typelevel" %%% "cats-free" % catsVersion,
"org.typelevel" %%% "cats-testkit" % catsVersion,
"org.typelevel" %%% "algebra" % catsVersion,
),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-effect" % catsEffectVersion,
"org.typelevel" %%% "cats-effect-kernel" % catsEffectVersion,
"org.typelevel" %%% "cats-effect-laws" % catsEffectVersion % Test,
),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-mtl" % catsMtlVersion,
"org.typelevel" %%% "cats-mtl-laws" % catsMtlVersion % Test,
),
libraryDependencies ++= Seq(
"co.fs2" %%% "fs2-core" % fs2Version,
"co.fs2" %%% "fs2-scodec" % fs2Version,
"co.fs2" %%% "fs2-io" % fs2Version,
),
// libraryDependencies ++= Seq(
// "org.typelevel" %%% "jawn-parser" % jawnVersion,
// "org.typelevel" %%% "jawn-ast" % jawnVersion,
// ),
libraryDependencies ++= Seq(
"org.typelevel" %%% "mouse" % "1.2.1",
"org.typelevel" %%% "kittens" % "3.0.0",
"org.typelevel" %%% "cats-collections-core" % "0.9.7",
),
libraryDependencies ++= Seq(
"org.typelevel" %%% "discipline-core" % "1.5.1",
"org.typelevel" %%% "discipline-scalatest" % "2.2.0" % Test,
"org.typelevel" %%% "discipline-specs2" % "1.4.0" % Test,
// "org.typelevel" %%% "discipline-munit" % "1.0.9" % Test,
),
libraryDependencies ++= Seq(
// "org.scalatest" %%% "scalatest" % scalaTestVersion % Test,
"org.scalatest" %%% "scalatest-funspec" % scalaTestVersion % Test,
"org.scalatest" %%% "scalatest-wordspec" % scalaTestVersion % Test,
),
libraryDependencies ++= Seq(
"org.specs2" %%% "specs2-core" % spec2Version % Test,
"org.specs2" %%% "specs2-scalacheck" % spec2Version % Test,
),
libraryDependencies ++= Seq(
"org.typelevel" %%% "spire" % "0.18.0",
"org.typelevel" %%% "cats-parse" % "0.3.10",
"org.typelevel" %%% "log4cats-core" % "2.6.0",
"org.scalacheck" %%% "scalacheck" % "1.17.0" % Test,

// "org.scalameta" %%% "munit" % "1.0.0" % Test,
// "org.scalameta" %%% "munit-scalacheck" % "0.7.29" % Test,
),
libraryDependencies ++= Dependencies.catsDeps.value,
libraryDependencies ++= Dependencies.catsEffectDeps.value,
libraryDependencies ++= Dependencies.catsMtlDeps.value,
libraryDependencies ++= Dependencies.fs2Deps.value,
libraryDependencies ++= Dependencies.jawnDeps.value,
libraryDependencies ++= Dependencies.scalaTestDeps.value,
libraryDependencies ++= Dependencies.specs2Deps.value,
libraryDependencies ++= Dependencies.disciplineDeps.value,
libraryDependencies ++= Dependencies.otherDeps.value,
)

val coreJvmSettings = Seq(
Expand Down
83 changes: 83 additions & 0 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
import org.scalajs.jsdependencies.sbtplugin.JSDependenciesPlugin.autoImport._
import sbt._

object Dependencies {
val scalaVersion = "3.3.0"

// Core
private val catsVersion = "2.9.0"
private val catsEffectVersion = "3.5.1"
private val catsMtlVersion = "1.3.1"
private val fs2Version = "3.8.0"
private val jawnVersion = "1.5.1"
private val scalaTestVersion = "3.2.16"
private val spec2Version = "4.19.2"

// Udash
val udashVersion = "0.9.0"
val udashJQueryVersion = "3.2.0"

// Backend
val jettyVersion = "9.4.51.v20230217"
val logbackVersion = "1.3.5"
val typesafeConfigVersion = "1.4.2"

// JS dependencies
val bootstrapVersion = "4.1.3"

val catsDeps = Def.setting(Seq(
"org.typelevel" %%% "cats-kernel" % catsVersion,
"org.typelevel" %%% "cats-core" % catsVersion,
"org.typelevel" %%% "cats-laws" % catsVersion,
"org.typelevel" %%% "cats-free" % catsVersion,
"org.typelevel" %%% "cats-testkit" % catsVersion,
"org.typelevel" %%% "algebra" % catsVersion,
))
val catsEffectDeps = Def.setting(Seq(
"org.typelevel" %%% "cats-effect" % catsEffectVersion,
"org.typelevel" %%% "cats-effect-kernel" % catsEffectVersion,
"org.typelevel" %%% "cats-effect-laws" % catsEffectVersion % Test,
))
val catsMtlDeps = Def.setting(Seq(
"org.typelevel" %%% "cats-mtl" % catsMtlVersion,
"org.typelevel" %%% "cats-mtl-laws" % catsMtlVersion % Test,
))
val fs2Deps = Def.setting(Seq(
"co.fs2" %%% "fs2-core" % fs2Version,
"co.fs2" %%% "fs2-scodec" % fs2Version,
"co.fs2" %%% "fs2-io" % fs2Version,
))
val jawnDeps = Def.setting(Seq(
"org.typelevel" %%% "jawn-parser" % jawnVersion,
"org.typelevel" %%% "jawn-ast" % jawnVersion,
))
val scalaTestDeps = Def.setting(Seq(
"org.scalatest" %%% "scalatest-funspec" % scalaTestVersion % Test,
"org.scalatest" %%% "scalatest-wordspec" % scalaTestVersion % Test,
))
val specs2Deps = Def.setting(Seq(
"org.specs2" %%% "specs2-core" % spec2Version % Test,
"org.specs2" %%% "specs2-scalacheck" % spec2Version % Test,
))
val munitDeps = Def.setting(Seq(
"org.scalameta" %%% "munit" % "1.0.0" % Test,
"org.scalameta" %%% "munit-scalacheck" % "0.7.29" % Test,
))
val disciplineDeps = Def.setting(Seq(
"org.typelevel" %%% "discipline-core" % "1.5.1",
"org.typelevel" %%% "discipline-scalatest" % "2.2.0" % Test,
"org.typelevel" %%% "discipline-specs2" % "1.4.0" % Test,
// "org.typelevel" %%% "discipline-munit" % "1.0.9" % Test,
))
val otherDeps = Def.setting(Seq(
"org.typelevel" %%% "mouse" % "1.2.1",
"org.typelevel" %%% "kittens" % "3.0.0",
"org.typelevel" %%% "cats-collections-core" % "0.9.7",
"org.typelevel" %%% "spire" % "0.18.0",
"org.typelevel" %%% "cats-parse" % "0.3.10",
"org.typelevel" %%% "log4cats-core" % "2.6.0",
"org.scalacheck" %%% "scalacheck" % "1.17.0" % Test,
))
}
21 changes: 17 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "1.1.1"

// core

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.22")
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")

addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")

// native

addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.14")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.22")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0")
// js

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")

0 comments on commit f671e3e

Please sign in to comment.