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

Use rules defined in SBT module within a multi-module build #1795

Open
cchantep opened this issue Jun 19, 2023 · 2 comments
Open

Use rules defined in SBT module within a multi-module build #1795

cchantep opened this issue Jun 19, 2023 · 2 comments

Comments

@cchantep
Copy link
Contributor

Currently it's not possible to use rules defined in a SBT modules in other modules of the same multi-modules project without publishing, aka not possible to use inter-module dependencies (e.g. dependsOn).

Local rules are not sufficient neither when rules are to be used accross several sibling modules, nor when the rules module itself needs specific libraryDependencies.

@bjaglin
Copy link
Collaborator

bjaglin commented Jun 24, 2023

Hi @cchantep !

By "rule defined in SBT module", I assume you are refering to that scenario (although the other one might be more maintainable if you start sharing rules across projets)?

I might be misinterpreting your request, but considering that local rules rely on a sbt configuration ScalafixConfig / "scalafix", you should already have full flexibility on dependency management.

Local rules are not sufficient neither when rules are to be used accross several sibling modules

You should be able to use service2.dependsOn(service1 % "scalafix->scalafix") (see docs).

nor when the rules module itself needs specific libraryDependencies.

Did you try service1 / libraryDependencies += "external" % "dependency" % "1.0.0" % ScalafixConfig ? (see docs)


Let me know if that helps. If it does, a PR to clarify the docs would be welcome. If it does not, a concrete example would help, to better understand your needs.

@bjaglin
Copy link
Collaborator

bjaglin commented Feb 5, 2024

Hi @cchantep, any feedback on that?

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

No branches or pull requests

2 participants