Skip to content

Commit 1cdc8b7

Browse files
author
James Santucci
committed
Declare all dependencies
1 parent 89e7c04 commit 1cdc8b7

File tree

3 files changed

+48
-18
lines changed

3 files changed

+48
-18
lines changed

build.sbt

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,33 @@ def scalaVersionSuffix(scalaVersion: String) = CrossVersion.partialVersion(scala
2020

2121
lazy val V = new {
2222
val cats: String = "2.7.0"
23+
val catsEffect: String = "3.3.4"
2324
val collectioncompat: String = "2.6.0"
2425
val github4s: String = "0.30.0"
2526
val http4s: String = "0.23.8"
2627
val runtime: String = "0.7.0"
28+
val sbtIO = "1.6.0"
2729
val scala: String = "2.13.8"
2830
val scala212: String = "2.12.15"
2931
val scalacheck: String = "1.15.4"
3032
val scalacheckShapeless: String = "1.3.0"
3133
val scalamacros: String = "2.1.1"
3234
val scalariform: String = "0.2.10"
3335
val scalatest: String = "3.2.11"
36+
val scalaXml: String = "2.0.1"
37+
val shapeless: String = "2.3.7"
3438
}
3539

3640
lazy val definitions = (project in file("definitions"))
3741
.settings(name := "definitions")
3842
.settings(
39-
crossScalaVersions := Seq(V.scala212, V.scala),
43+
crossScalaVersions := Seq(V.scala),
4044
libraryDependencies ++= Seq(
4145
"org.typelevel" %% "cats-core" % V.cats,
4246
"org.scalacheck" %% "scalacheck" % V.scalacheck,
4347
"com.github.alexarchambault" %% "scalacheck-shapeless_1.15" % V.scalacheckShapeless,
4448
"org.scalatest" %% "scalatest-core" % V.scalatest,
45-
"org.scalatest" %% "scalatest" % V.scalatest
49+
"com.chuusai" %% "shapeless" % V.shapeless
4650
),
4751
dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1"
4852
)
@@ -51,21 +55,27 @@ lazy val compiler = (project in file("compiler"))
5155
.settings(name := "exercise-compiler")
5256
.settings(
5357
exportJars := true,
54-
crossScalaVersions := Seq(V.scala212, V.scala),
58+
crossScalaVersions := Seq(V.scala),
5559
scalacOptions -= "-Xfatal-warnings",
5660
libraryDependencies ++= Seq(
57-
"org.scala-exercises" %% "runtime" % V.runtime,
58-
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
59-
"org.typelevel" %% "cats-core" % V.cats % Compile,
60-
"org.http4s" %% "http4s-blaze-client" % V.http4s,
61-
"org.http4s" %% "http4s-circe" % V.http4s,
62-
"com.47deg" %% "github4s" % V.github4s,
63-
"org.scalariform" %% "scalariform" % V.scalariform,
64-
"org.typelevel" %% "cats-laws" % V.cats % Test,
65-
"org.scalatest" %% "scalatest-core" % V.scalatest % Test,
66-
"org.scalatest" %% "scalatest" % V.scalatest % Test
61+
"org.scala-exercises" %% "runtime" % V.runtime,
62+
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
63+
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
64+
"org.scala-lang.modules" %% "scala-xml" % V.scalaXml,
65+
"org.typelevel" %% "cats-core" % V.cats % Compile,
66+
"org.http4s" %% "http4s-blaze-client" % V.http4s,
67+
"org.http4s" %% "http4s-client" % V.http4s,
68+
"com.47deg" %% "github4s" % V.github4s,
69+
"org.scalariform" %% "scalariform" % V.scalariform,
70+
"org.typelevel" %% "cats-kernel" % V.cats,
71+
"org.typelevel" %% "cats-laws" % V.cats % Test,
72+
"org.typelevel" %% "cats-effect" % V.catsEffect,
73+
"org.typelevel" %% "cats-effect-kernel" % V.catsEffect,
74+
"org.scalatest" %% "scalatest-core" % V.scalatest % Test,
75+
"org.scalatest" %% "scalatest" % V.scalatest % Test
6776
),
68-
dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1"
77+
dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.0.1",
78+
unusedCompileDependenciesFilter -= moduleFilter("org.scala-lang", "scala-compiler")
6979
)
7080
.dependsOn(definitions)
7181

@@ -76,8 +86,26 @@ lazy val `sbt-exercise` = (project in file("sbt-exercise"))
7686
.settings(
7787
scalacOptions -= "-Xfatal-warnings",
7888
scalacOptions += "-Ypartial-unification",
79-
libraryDependencies += "org.typelevel" %% "cats-core" % V.cats % Compile,
80-
addCompilerPlugin("org.scalamacros" % "paradise" % V.scalamacros cross CrossVersion.full),
89+
libraryDependencies ++= Seq(
90+
"org.scala-sbt" %% "actions" % sbtVersion.value,
91+
"org.scala-sbt" %% "collections" % sbtVersion.value,
92+
"org.scala-sbt" % "compiler-interface" % sbtVersion.value,
93+
"org.scala-sbt" %% "core-macros" % sbtVersion.value,
94+
"org.scala-sbt" %% "io" % V.sbtIO,
95+
"org.scala-sbt" %% "librarymanagement-core" % sbtVersion.value,
96+
"org.scala-sbt" %% "main" % sbtVersion.value,
97+
"org.scala-sbt" %% "main-settings" % sbtVersion.value,
98+
"org.scala-sbt" % "sbt" % sbtVersion.value,
99+
"org.scala-sbt" %% "task-system" % sbtVersion.value,
100+
"org.scala-sbt" %% "util-logging" % sbtVersion.value,
101+
"org.scala-sbt" %% "util-position" % sbtVersion.value,
102+
"org.scala-sbt" %% "zinc-apiinfo" % sbtVersion.value,
103+
"org.scala-sbt" %% "zinc-classpath" % sbtVersion.value,
104+
"org.scala-sbt" %% "zinc-core" % sbtVersion.value,
105+
"org.typelevel" %% "cats-core" % V.cats,
106+
"org.typelevel" %% "cats-kernel" % V.cats
107+
),
108+
// addCompilerPlugin("org.scalamacros" % "paradise" % V.scalamacros cross CrossVersion.full),
81109
// Leverage build info to populate compiler classpath--
82110
compilerClasspath := { (compiler / Compile / fullClasspath) }.value,
83111
buildInfoObject := "Meta",

compiler/src/main/scala/org/scalaexercises/exercises/compiler/SourceTextExtraction.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import java.io.File
2121
import org.scalaexercises.exercises.compiler.CompilerSettings
2222

2323
import scala.annotation.tailrec
24-
import scala.collection.compat._
2524
import scala.reflect.internal.util.BatchSourceFile
2625
import scala.tools.nsc._
2726
import scala.tools.nsc.doc.{Settings => _, _}
@@ -91,7 +90,7 @@ class SourceTextExtraction {
9190
val rawImports = extraction.imports
9291
val paths = rawImports.map(expandPath)
9392

94-
val imports = paths.groupBy(_._1).view.mapValues(_.map(_._2)).toMap
93+
val imports = paths.groupBy(_._1).mapValues(_.map(_._2)).toMap
9594

9695
val methods = extraction.methods.map(expandPath).map { case (k, v) =>
9796
lazy val methodImports = k

project/plugins.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.11.2"
99
addSbtPlugin("com.alejandrohdezma" % "sbt-remove-test-from-pom" % "0.1.0")
1010
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")
1111
addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % "0.3.3")
12+
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16")
1213

1314
libraryDependencies += "com.spotify" % "missinglink-core" % "0.2.5"
15+
16+
addDependencyTreePlugin

0 commit comments

Comments
 (0)