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

Extra report info #44

Merged
merged 7 commits into from
Jun 14, 2018
Merged

Conversation

markhoughton
Copy link
Contributor

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:

  1. 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.

  2. 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.

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.
@markhoughton
Copy link
Contributor Author

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
Copy link
Owner

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")
Copy link
Owner

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"
Copy link
Owner

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"

@jaredsburrows
Copy link
Owner

Changed "dependency_string" to "dependency" in the JSON output.
Made some strings into constants.
@markhoughton
Copy link
Contributor Author

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.

@jaredsburrows
Copy link
Owner

@markhoughton Sorry, can update the README.md to show the updated reports, the HTML and JSON?

@jaredsburrows
Copy link
Owner

@markhoughton bump

]
],
"dependency": "com.android.support:design:26.1.0"
},
Copy link
Owner

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. :/

Copy link
Owner

Choose a reason for hiding this comment

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

screen shot 2018-06-13 at 9 23 07 am

@jaredsburrows jaredsburrows merged commit 9831233 into jaredsburrows:master Jun 14, 2018
@jaredsburrows
Copy link
Owner

Thanks.

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