Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract list of dependencies from the BOM #13

Merged
merged 4 commits into from
Feb 12, 2024
Merged

Conversation

gaeljw
Copy link
Contributor

@gaeljw gaeljw commented Feb 4, 2024

Solves #9

This adds:

  • a bomDependencies: Seq[ModuleID] method to Bom instances
  • a Bom.dependencies(...) helper method in the companion object for cases where you only care about bomDependencies but don't need to extract anything else manually from the Bom

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
...

See the context of this feature at heremaps#9

Signed-off-by: Gaël Jourdan-Weil <gjourdanweil@gmail.com>
Signed-off-by: Gaël Jourdan-Weil <gjourdanweil@gmail.com>
Signed-off-by: Gaël Jourdan-Weil <gjourdanweil@gmail.com>
…solver if needed

Signed-off-by: Gaël Jourdan-Weil <gjourdanweil@gmail.com>
@gaeljw
Copy link
Contributor Author

gaeljw commented Feb 9, 2024

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

@molekyla
Copy link
Collaborator

molekyla commented Feb 9, 2024

@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

molekyla added a commit to molekyla/sbt-bom-example-github that referenced this pull request Feb 12, 2024
molekyla added a commit to molekyla/sbt-bom-example-github that referenced this pull request Feb 12, 2024
Copy link
Collaborator

@molekyla molekyla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contribution. I see no issues related to introduced functionality

@molekyla molekyla merged commit 1077445 into heremaps:master Feb 12, 2024
3 checks passed
@gaeljw gaeljw deleted the gh9 branch February 12, 2024 13:09
@gaeljw
Copy link
Contributor Author

gaeljw commented Feb 12, 2024

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

@molekyla
Copy link
Collaborator

molekyla commented Feb 12, 2024

@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
Copy link
Contributor Author

gaeljw commented Feb 12, 2024

Awesome! Will use it right now then :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants