-
-
Notifications
You must be signed in to change notification settings - Fork 369
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 in ability to pass in whatDependsOn
to JavaModule.ivyDepsTree
#2191
Conversation
Thank you @ckipp01 for this PR. I'll need some more time to do a review. For context, I'm still in search of a principled approach to evolve commands with arguments in a convenient but compatible way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this PR essentially contains a new feature which I really like and introduces some new experimental pattern for commands. I think we need to get more experience with the latter, so I won't address it now. I'll open a discussion when I find the time. Just for now, it's probably fair to tell you, that it's not clear if we will keep it like it is in this PR or change it.
Feature wise, the only thing I'm missing is a better guide for the user on how to use it. The PR description is already very good, but we either need to add some more info what kind of parameters the command parameter --whatDependsOn
accepts to the scaladoc (which can be read with mill inspect foo.ivyDepsTree
) or we need to add something to the documentation. Ideally we do both.
There is a section about |
That's totally fine. I'm glad I can be a guinea pig using this approach and hopefully it will provide insight into the best way to do this moving forward.
For sure, let me add both. |
0fa1155
to
32ca4b6
Compare
This pr introduces the ability to also pass n `whatDependsOn` when using the `ivyDepsTree` command. For example if you were to use the following: ``` mill main.ivyDepsTree ``` You'd get a giant tree to parse through or maybe grep if you're looking for something specific. Coursier has the ability to target specific entries in the tree and treat those at roots in order for you to clearly see where they come from. To give a couple examples, you can now pass in multiple `--whatDependsOn` to get the minimal trees you're looking for. _An example of one_ ``` ❯ ./mill -i dev.run ~/Documents/scala-workspace/com-lihaoyi/mill main.ivyDepsTree --whatDependsOn com.github.plokhotnyuk.jsoniter-scala:jsoniter-scala-core_2.13 [69/780] de.tobiasroeser.mill.vcs.version.VcsVersion.vcsState [780/780] dev.run [33/33] main.ivyDepsTree └─ com.github.plokhotnyuk.jsoniter-scala:jsoniter-scala-core_2.13:2.13.5 ├─ io.get-coursier:coursier_2.13:2.1.0-RC1 └─ org.virtuslab.scala-cli:config_2.13:0.1.16 └─ io.get-coursier:coursier-cache_2.13:2.1.0-RC1 └─ io.get-coursier:coursier_2.13:2.1.0-RC1 ``` _An example of what it looks like when passing in multiple_ ``` ❯ ./mill -i dev.run ~/Documents/scala-workspace/com-lihaoyi/mill main.ivyDepsTree --whatDependsOn com.github.plokhotnyuk.jsoniter-scala:jsoniter-scala-core_2.13 --whatDependsOn org.jline:jline [69/780] de.tobiasroeser.mill.vcs.version.VcsVersion.vcsState [780/780] dev.run [33/33] main.ivyDepsTree ├─ com.github.plokhotnyuk.jsoniter-scala:jsoniter-scala-core_2.13:2.13.5 │ ├─ io.get-coursier:coursier_2.13:2.1.0-RC1 │ └─ org.virtuslab.scala-cli:config_2.13:0.1.16 │ └─ io.get-coursier:coursier-cache_2.13:2.1.0-RC1 │ └─ io.get-coursier:coursier_2.13:2.1.0-RC1 └─ org.jline:jline:3.21.0 └─ org.scala-lang:scala-compiler:2.13.10 ├─ com.lihaoyi:ammonite-compiler_2.13.10:2.5.5 │ └─ com.lihaoyi:ammonite_2.13.10:2.5.5 ├─ com.lihaoyi:mill-moduledefs_2.13:0.10.9 │ └─ com.lihaoyi:scalac-mill-moduledefs-plugin_2.13.10:0.10.9 └─ com.lihaoyi:scalac-mill-moduledefs-plugin_2.13.10:0.10.9 ``` I used the trick you showed me in com-lihaoyi#2033 (reply in thread) so I _believe_ this should be done in a compatible way.
32ca4b6
to
434ef2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you!
whatDependsOn
to ivyDepsTree
whatDependsOn
to JavaModule.ivyDepsTree
This pr introduces the ability to also pass in
whatDependsOn
when using theivyDepsTree
command. For example if you were to use the following:You'd get a giant tree to parse through or maybe grep if you're looking for something specific. Coursier has the ability to target specific entries in the tree and treat those at roots in order for you to clearly see where they come from. To give a couple examples, you can now pass in multiple
--whatDependsOn
to get the minimal trees you're looking for.An example of one
An example of what it looks like when passing in multiple
I used the trick you showed me in
#2033 (reply in thread) so I believe this should be done in a compatible way.