-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Extra report info #44
Extra report info #44
Conversation
1. List dependencies for which no license was found. For these, licenses will be an empty array for the JSON report, and the HTML report will show a category for "no license found". 2. Include the original Gradle dependency string in the JSON report (useful to track down dependencies when the description is not enough).
Updated tests to include cases with and without license info, and to include the dependency string in the JSON report tests.
I know the tests are not passing. Will try to find time to fix them soon. |
@@ -8,4 +8,5 @@ final class Project { | |||
String url | |||
List<Developer> developers | |||
String year | |||
String dependencyString |
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.
Can this be gav
or dependency
?
@@ -35,7 +36,12 @@ final class HtmlReport { | |||
|
|||
// Store packages by license | |||
projects.each { project -> | |||
def key = project.licenses[0] | |||
def key = new License(name: "No license found", url: "N/A") |
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.
Can you make these constants?
@@ -15,6 +15,7 @@ final class JsonReport { | |||
private final static def LICENSE = "license" | |||
private final static def LICENSE_URL = "license_url" | |||
private final static def EMPTY_JSON_ARRAY = "[]" | |||
private final static def DEPENDENCY_STRING = "dependency_string" |
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.
private final static def DEPENDENCY = "dependency"
Just to let you know, you notice your image does not match your commit user image. See: https://help.github.com/articles/setting-your-username-in-git/ and https://stackoverflow.com/questions/750172/change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-git#1320317 |
Changed "dependency_string" to "dependency" in the JSON output. Made some strings into constants.
Thanks for pointing out the mismatch in my commit user image. That's because I am using this plugin at work and committing from my work computer, which uses my company email address. But I am signed in to Github using my personal details - hence the discrepancy. |
@markhoughton Sorry, can update the |
@markhoughton bump |
…h no license information available.
] | ||
], | ||
"dependency": "com.android.support:design:26.1.0" | ||
}, |
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.
The indentation here is wrong. :/
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.
Thanks. |
I needed to add some extra info into the JSON report for my own purposes. If you feel this is useful for others too, then please consider merging.
There are two related changes here:
Add dependencies for which no licenses were found into the reports, with an empty licenses array in the JSON report. The HTML report adds dependencies with no licenses in a "no licenses found" section.
Add the original gradle dependency string (group:name:version string) into the JSON report - makes it easier to track down a dependency if the description is not enough.