heremaps / here-sbt-bom

SBT BOM is the plugin for SBT for dealing with Maven BOM in SBT projects
Other
16 stars 5 forks source link

Extract list of dependencies from the BOM #13

Closed gaeljw closed 5 months ago

gaeljw commented 5 months ago

Solves #9

This adds:

I've also updated the README with documentation on this new usage and small changes (each in a different commit).

Tests

I've tested this locally using the example described in #9 and it works successfully.

Example build.sbt file:

import sbt._
import com.here.bom.Bom

lazy val jacksonBom = Bom.dependencies("com.fasterxml.jackson" % "jackson-bom" % "2.16.0")

lazy val `sbt-bom-example-github` = project
  .in(file("."))
  .settings(jacksonBom)
  .settings(
    name := "sbt-bom-example-github",
    // resolvers := Resolver.mavenCentral +: resolvers.value,
    libraryDependencies += "com.typesafe.play" %% "play" % "2.8.21",
    libraryDependencies += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.15.0",
    dependencyOverrides ++= jacksonBom.key.value,
  )

Which gives the expected result in terms of versions. Here's a sbt dependencyTree extract:

[info] sbt-bom-example-github:sbt-bom-example-github_2.12:0.1.0-SNAPSHOT [S]
[info]   +-com.fasterxml.jackson.module:jackson-module-scala_2.12:2.16.0
[info]   +-com.typesafe.play:play_2.12:2.8.21 [S]
[info]     +-com.fasterxml.jackson.core:jackson-annotations:2.16.0
[info]     +-com.fasterxml.jackson.core:jackson-core:2.16.0
[info]     +-com.fasterxml.jackson.core:jackson-databind:2.16.0
[info]     | +-com.fasterxml.jackson.core:jackson-annotations:2.16.0
[info]     | +-com.fasterxml.jackson.core:jackson-core:2.16.0
[info]     | 
[info]     +-com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.16.0
[info]     | +-com.fasterxml.jackson.core:jackson-core:2.16.0
[info]     | +-com.fasterxml.jackson.core:jackson-databind:2.16.0
[info]     |   +-com.fasterxml.jackson.core:jackson-annotations:2.16.0
[info]     |   +-com.fasterxml.jackson.core:jackson-core:2.16.0
[info]     |   
[info]     +-com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.0
[info]     | +-com.fasterxml.jackson.core:jackson-annotations:2.16.0
[info]     | +-com.fasterxml.jackson.core:jackson-core:2.16.0
[info]     | +-com.fasterxml.jackson.core:jackson-databind:2.16.0
[info]     |   +-com.fasterxml.jackson.core:jackson-annotations:2.16.0
[info]     |   +-com.fasterxml.jackson.core:jackson-core:2.16.0
...
gaeljw commented 5 months ago

@molekyla could you (or someone else) give a look at this PR? The feature would be quite useful to me.

molekyla commented 5 months ago

@gaeljw Sorry for delay. I haven't enough time to test this changes. At the first glance it looks good, but I want to test it on my small project. Will give take a look in a next few day

gaeljw commented 5 months ago

Thanks @molekyla . Do you know when this can be part of a release?

molekyla commented 5 months ago

@gaeljw Already been released under the 1.0.8 version. Despite that label in the README.md file shows that latest version is 1.0.7

Also this changes will be integrated in examples in near future

gaeljw commented 5 months ago

Awesome! Will use it right now then :D