Skip to content

Commit

Permalink
Check undeclared and unused dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
seblm committed Dec 14, 2024
1 parent abfec9d commit 3f96c9d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
distribution: 'temurin'
java-version: '17'
cache: 'sbt'
- run: sbt scalafmtCheckAll test jgiven-scalatest-reporter/publishLocal scripted
- run: sbt scalafmtCheckAll undeclaredCompileDependenciesTest unusedCompileDependenciesTest test jgiven-scalatest-reporter/publishLocal scripted
- uses: scalacenter/sbt-dependency-submission@v3
17 changes: 13 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ lazy val `sbt-jgiven-scalatest-reporter` = (project in file("."))
.settings(
commonSettings,
scalaVersion := "2.12.20",
libraryDependencies += `sbt-`,
libraryDependencies += `sbt-actions`,
libraryDependencies += `sbt-collections`,
libraryDependencies += `sbt-core-macros`,
libraryDependencies += `sbt-librarymanagement-core`,
libraryDependencies += `sbt-main`,
libraryDependencies += `sbt-main-settings`,
libraryDependencies += `sbt-task-system`,
libraryDependencies += `sbt-testing`,
libraryDependencies += `sbt-util-position`,
scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq("-Dplugin.version=" + version.value) },
scriptedBufferLog := false
)
Expand All @@ -25,12 +35,11 @@ lazy val `jgiven-scalatest-reporter` = project
.settings(
commonSettings,
scalaVersion := "2.13.15",
libraryDependencies += `commons-io`,
libraryDependencies += `jgiven-core`,
libraryDependencies += `jgiven-html5-report`,
libraryDependencies += `log4j-slf4j-impl`,
libraryDependencies += scalatest,
libraryDependencies += `slf4j-api`,
libraryDependencies += `scalatest-core`,
libraryDependencies += `scalatest-featurespec`,
Test / parallelExecution := false
)
.dependsOn(`json-scalatest-reporter` % Test)
Expand All @@ -41,7 +50,7 @@ lazy val `json-scalatest-reporter` = project
scalaVersion := "2.13.15",
libraryDependencies += gson,
libraryDependencies += `log4j-slf4j-impl`,
libraryDependencies += scalatest,
libraryDependencies += `scalatest-core`,
libraryDependencies += `slf4j-api`,
Test / parallelExecution := false
)
Expand Down
16 changes: 14 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ import sbt.*
object Dependencies {

private val jGivenVersion = "2.0.1"
private val sbtVersion = "1.10.6"
private val scalatestVersion = "3.2.19"

lazy val `commons-io` = "commons-io" % "commons-io" % "2.18.0" % Runtime // Please remove this dependency once jgiven-html5-report will transitively depend on it
lazy val gson = "com.google.code.gson" % "gson" % "2.11.0"
lazy val `jgiven-core` = "com.tngtech.jgiven" % "jgiven-core" % jGivenVersion
lazy val `jgiven-html5-report` = "com.tngtech.jgiven" % "jgiven-html5-report" % jGivenVersion exclude ("commons-io", "commons-io")
lazy val `log4j-slf4j-impl` = "org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.24.3" % Test
lazy val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
lazy val `scalatest-core` = "org.scalatest" %% "scalatest-core" % scalatestVersion
lazy val `scalatest-featurespec` = "org.scalatest" %% "scalatest-featurespec" % scalatestVersion
lazy val `sbt-` = "org.scala-sbt" % "sbt" % sbtVersion // append dash to avoid error: <expected-type>:1: error: value internal is not a member of sbt.librarymanagement.ModuleID sbt.internal.DslEntry
lazy val `sbt-actions` = "org.scala-sbt" %% "actions" % sbtVersion
lazy val `sbt-collections` = "org.scala-sbt" %% "collections" % sbtVersion
lazy val `sbt-core-macros` = "org.scala-sbt" %% "core-macros" % sbtVersion
lazy val `sbt-librarymanagement-core` = "org.scala-sbt" %% "librarymanagement-core" % "1.10.3"
lazy val `sbt-main` = "org.scala-sbt" %% "main" % sbtVersion
lazy val `sbt-main-settings` = "org.scala-sbt" %% "main-settings" % sbtVersion
lazy val `sbt-task-system` = "org.scala-sbt" %% "task-system" % sbtVersion
lazy val `sbt-testing` = "org.scala-sbt" %% "testing" % sbtVersion
lazy val `sbt-util-position` = "org.scala-sbt" %% "util-position" % sbtVersion
lazy val `slf4j-api` = "org.slf4j" % "slf4j-api" % "2.0.16"

}
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")

0 comments on commit 3f96c9d

Please sign in to comment.