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

Add support for global excluding of transitive dependencies #3354

Open
3 tasks
Gedochao opened this issue Dec 6, 2024 · 4 comments
Open
3 tasks

Add support for global excluding of transitive dependencies #3354

Gedochao opened this issue Dec 6, 2024 · 4 comments
Labels
coursier Issues tied with coursier integration. dependency management Issues tied to how the CLI manages project dependencies. enhancement New feature or request

Comments

@Gedochao
Copy link
Contributor

Gedochao commented Dec 6, 2024

Is your feature request related to a problem? Please describe.
We'd like a way to globally exclude transitive dependencies, rather than doing it via individual dep param (exclude=*, as described in https://scala-cli.virtuslab.org/docs/guides/introduction/dependencies/#excluding-transitive-dependencies).

Describe the solution you'd like

  • using directive: //> using dep.exclude org.scala-lang.modules::scala-collection-compat:2.12.0
  • command line option: --dependency-exclude org.scala-lang.modules::scala-collection-compat:2.12.0
  • passing the dependency without an explicit version should exclude it independent of the transitive version, i.e.: //> using dep.exclude org.scala-lang.modules::scala-collection-compat would get rid of all transitive scala-collection-compat

Describe alternatives you've considered
Keep excluding per dependency, when necessary.

Additional context
Initially suggested by @prolativ.

@Gedochao Gedochao added enhancement New feature or request coursier Issues tied with coursier integration. dependency management Issues tied to how the CLI manages project dependencies. labels Dec 6, 2024
@tgodzik
Copy link
Member

tgodzik commented Dec 6, 2024

Not sure if we have actual way to exclude a specific version, does coursier have an API for that?

@prolativ
Copy link

prolativ commented Dec 6, 2024

This should also work with other variants of dep, e.g. compileOnly.dep.exclude or test.dep.exclude

@prolativ
Copy link

prolativ commented Dec 6, 2024

Shouldn't the command line option be named --dep-exclude? Or maybe we should at least have such an alias?
In order to keep symmetry with --compile-dep, while --compile-dependency is missing

@Gedochao
Copy link
Contributor Author

Gedochao commented Dec 6, 2024

Shouldn't the command line option be named --dep-exclude? Or maybe we should at least have such an alias? In order to keep symmetry with --compile-dep, while --compile-dependency is missing

yeah, we should have an alias in compliance with --dep/--dependency.
I suppose --compile-dependency is a missing alias, here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coursier Issues tied with coursier integration. dependency management Issues tied to how the CLI manages project dependencies. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants