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

Support for projects unlinked from root #1481

Closed
blast-hardcheese opened this issue Jun 14, 2020 · 3 comments
Closed

Support for projects unlinked from root #1481

blast-hardcheese opened this issue Jun 14, 2020 · 3 comments

Comments

@blast-hardcheese
Copy link
Contributor

For some time, I was wondering why only some libraries on https://github.com/twilio/guardrail/ were receiving library update PRs.

After digging in a bit, running stewardDependencies locally, I discovered that due to stewardDependencies collecting libraryDependencies from the project it was launched in, if there were any projects that were only accessible fully qualified, they'd be completely left out of analysis.

To put it differently,

sbt> stewardDependencies // Only lists a couple dependencies, defined on `root`
sbt> sampleAkkaHttp/stewardDependencies // Finds dependencies that need to be updated

The reason for this is surely due to my lack of how to properly structure an SBT project to serve my needs, but the guardrail integration tests are run in subprojects that are only able to be compiled during integration tests, as all other times the required source files have not been generated yet.

I was able to play a little shell game with my dependencies, which works pretty decently: guardrail-dev/guardrail#664

... though I wonder if there's not a more elegant solution for this problem, perhaps .steward.conf containing projects = foo, bar, baz or similar.

This seems somewhat related to #1158 as well, though that issue seems to be with multiple, separate invocation roots, whereas mine is just separate command prefixes plus an aggregation phase.

As always, thank you for this excellent tool, and have a fantastic day writing Scala!

@fthomas
Copy link
Member

fthomas commented Aug 6, 2020

You're right that Scala Steward only updates dependencies that are listed by libraryDependencies of the root project. Running that task in the root project will only run it in subprojects that are aggregated by the root project. I'm not aware of a way to list dependencies for all subprojects regardless whether they are aggregated by the root project or not. If it exists I'm open to discussing if Scala Steward should be changed in this direction.

I also think that guardrail-dev/guardrail#664 looks like a good workaround when you don't want certain subprojects aggregated in the root project but still want to benefit from Scala Steward's automatic updates. The good thing about this solution is that library definitions are still only in the sbt build and do not need to be duplicated in some Scala Steward specific config file.

@eugeniyk
Copy link
Contributor

@blast-hardcheese what we endup with giter8 templates (same - empty root dependencies, but lot's inside) is to regenerate dependencies.gen.sbt inside root that will aggregate them (simple bash scripts ;)

Then Scala steward update in both places - root (gen) and under

@exoego
Copy link
Contributor

exoego commented Feb 9, 2022

IIUC, this is covered by repo-specific config

buildRoots = [ ".", "subfolder/projectA" ]

which was introduced in #1875
So let me close as resolved.
See https://github.com/scala-steward-org/scala-steward/blob/main/docs/repo-specific-configuration.md for config detail.

@exoego exoego closed this as completed Feb 9, 2022
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

No branches or pull requests

4 participants