[2.x] feat: dependencyLicenseInfo#8506
Merged
eed3si9n merged 3 commits intosbt:developfrom Jan 13, 2026
Merged
Conversation
- Add LicenseInfo rendering object with text and JSON output - Add dependencyLicenseInfo input task key - Implement dependencyLicenseInfo task with JSON format support - Supports --out option for file output - Auto-detects JSON format from .json file extension - Follows same pattern as dependencyTree task Resolves sbt#7771
Member
|
Thanks for the contribution. Could you add integration test under https://github.com/sbt/sbt/tree/develop/sbt-app/src/sbt-test/dependency-graph please? The details on the scipted tests are here - https://github.com/sbt/sbt/blob/develop/contributing-docs/05_scripted_tests.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds JSON output support to the
dependencyLicenseInfotask, addressing issue #7771. The implementation follows the same pattern as the existingdependencyTreetask which already supports JSON output (#7770).Changes
Created
LicenseInfo.scalainsbt/internal/graph/rendering/:render()method for text output (matches original implementation)renderJson()method for JSON output usingLList.isopattern consistent with codebaseAdded
dependencyLicenseInfokey toDependencyTreeKeys.scalaImplemented
dependencyLicenseInfotask inDependencyTreeSettings.scala:jsonformat or.jsonfile extension--outoption for file output--quietoptionArgsParserandhandleOutpututilitiesFeatures
licenseandmodulesfields--out licenses.json)Usage Examples
Related Issues
dependencyLicenseInfoshould also display/write json, not just text #7771dependencyTreeshould also display/write json, not just text #7770 (dependencyTree JSON support - already implemented)Files Changed
main/src/main/scala/sbt/internal/graph/rendering/LicenseInfo.scala(new file, 63 lines)main/src/main/scala/sbt/plugins/DependencyTreeKeys.scala(+1 line)main/src/main/scala/sbt/plugins/DependencyTreeSettings.scala(+44 lines)Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=157775043