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

Recursive module publishing #194

Merged
merged 3 commits into from
Mar 2, 2025
Merged

Recursive module publishing #194

merged 3 commits into from
Mar 2, 2025

Conversation

NPCRUS
Copy link
Collaborator

@NPCRUS NPCRUS commented Feb 28, 2025

for every module that extends RecursivePublishModule - publishLocal command will instead call publishLocal command for all of it's moduleDeps that extends PublishModule trait. also there is support for all module, which will resolve dependencies of it's child modules like web or test.
It doesn't go deeper than that, so that dependencies of modules that extends PublishModule are not included.

…s to be published by invoking .publishLocal command
@NPCRUS NPCRUS requested a review from propensive February 28, 2025 13:22
Comment on lines +94 to +106
trait RecursivePublishModule { self: BaseScalaModule =>
def publishLocal(localIvyRepo: String = null): Command[Unit] = Task.Command {
T.traverse(
this.moduleDeps.flatMap {
case m: RecursivePublishModule => m.moduleDeps
case m => Seq(m)
}.collect {
case m: PublishModule => m
}
)(module => module.publishLocal().t)()
Result.Success(())
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need to define a similar publish method too, to support real publishing?

Also, my assumption is that this will attempt to publish all the modules exactly once because (and only because) it's the direct dependencies of the soundness "bundle" modules, which refer to each of the real modules exactly once. That's probably fine: if a module gets forgotten because it's not included as a direct dependency of one of the bundles, then the first time we try to resolve it from a build tool, we will discover that it's not been published.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think yes, we do
this is also correct, it only publishes modules that are included in one of the soundness.* module dependencies
But you want to be able to just publish ALL modules, right?

Copy link
Owner

Choose a reason for hiding this comment

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

I think it's fine. Would you like me to merge this as-is, or should I hang on for a publish implementation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i'll play with it a bit more - i'll give you green light, when im done

@NPCRUS
Copy link
Collaborator Author

NPCRUS commented Mar 2, 2025

merge pls

@propensive propensive merged commit 39548b4 into main Mar 2, 2025
1 check passed
@propensive propensive deleted the recursive-publishing branch March 2, 2025 11:47
@propensive
Copy link
Owner

Thank you!

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.

3 participants