-
Notifications
You must be signed in to change notification settings - Fork 937
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
[2.x] Refactor dependencyTree
into an input task
#7849
base: develop
Are you sure you want to change the base?
Conversation
import sbt.Project._ | ||
import sbt.librarymanagement.Configurations.{ Compile, Test } | ||
|
||
object DependencyReportPlugin extends AutoPlugin { |
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.
For sbt 2.x, I wonder if we could consolidate 3 dependency-tree plugins into one. When we in-sourced it to sbt/sbt we had to split it into two because of the amount of setting keys it introduced to all subproject slowed down large builds. If we can reduce the number of injected settings we use this opportunity to do so.
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.
My concern is that there's some settings that are currently unsupported as they are ugly to support via command line argument (e.g. Graph customization options as part of full dependency tree plugin).
I don't know whether people actually use these settings though.
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.
@mkurz What is your opinion on Eugene's idea of consolidating 3 dependency-tree plugins into one?
I personally don't use dependency tree plugin often so need feedback from dependency tree plugin users to make major decisions like this.
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.
I can confirm that the lack of consolidation is rather mystifying for users. It comes up from time to time on Discord.
@@ -35,6 35,12 @@ trait MiniDependencyTreeKeys { | |||
|
|||
object MiniDependencyTreeKeys extends MiniDependencyTreeKeys | |||
|
|||
trait DependencyReportKeys { | |||
val dependencyReport = inputKey[Unit]("Generates a report of the project dependencies") |
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.
Not everything is a tree, but here too I'm thinking we should just use dependencyTree
key in sbt 2.x, and maybe dependencyTreeNext
or something if we introduce it to 1.x?
Following Eugene's comment, this PR refactors
dependencyTree
into an input task, with the aim ofMiniDependencyTreePlugin
DependencyTreePlugin
json
output to both terminal & fileThe refactored input task is called
dependencyReport
. OldMiniDependencyTreePlugin
settings are still kept for compatibility purpose.Syntax
dependencyReport [format] [subformat]
Parameters
format: text|json|html|graphml
: specifies the format of the output, defaults totext
subformat
: if applicable further specifies format of outputtext
format:subformat
takeslist|stat|info
, corresponding todependencyList
,dependencyStats
,dependencyLicenseInfo
. Emptysubformat
corresponds todependencyTree
html
format:subformat
takestree|graph
, corresponding tobrowseTreeHTMLTask, browseGraphHTMLTask
json/graphml
format: does not takesubformat
Example
Closes #7770