-
-
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
Added option to ignore a set of group IDs from the report #168
Added option to ignore a set of group IDs from the report #168
Conversation
Change-Id: I098a8bc3d177798bb3237dff918bec493116934a
@@ -40,6 +40,7 @@ internal open class LicenseReportTask : DefaultTask() { // tasks can't be final | |||
@Input var copyCsvReportToAssets = false | |||
@Input var copyHtmlReportToAssets = false | |||
@Input var copyJsonReportToAssets = false | |||
@Input var ignoredGroupIds: Set<String> = setOf() |
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.
@Input var ignoredGroupIds = setOf<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.
Absolutely
@@ -167,6 +168,12 @@ internal open class LicenseReportTask : DefaultTask() { // tasks can't be final | |||
val pomFile = resolvedArtifact.file | |||
val node = xmlParser.parse(pomFile) | |||
|
|||
// If group ID is part of ignored groups, skip this artifact | |||
val groupId = node.getAt("groupId").text().trim() |
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.
Add test for 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'm not particularly versed in Groovy that so that'll take me some time to figure out. I'll get back to you.
* Added unit tests for ignoring one and all group IDs respectively.
@@ -1212,4 +1212,171 @@ final class LicensePluginAndroidSpec extends Specification { | |||
taskName << ['licenseDebugReport', 'licenseReleaseReport'] | |||
copyEnabled << [true, false] | |||
} | |||
|
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.
@jaredsburrows Do you want me to add these tests to the LicensePluginJavaSpec too?
Hello @jaredsburrows, It's been a couple of months, and I'm wondering if you plan to merge my pull request. If not, I'll just leave it be, otherwise I'll squash the commits, rebase and put a new one on top of latest master for you to review. |
@mudkiplex Can you please sync this? |
Fixed conflicts: * Used new file structure. * Fixed unit tests.
@jaredsburrows I believed I've managed to sync with latest master correctly. Please have a look. |
Thanks! @mudkiplex Should we consider adding |
Also we should probably update the |
We could do that. I'm not sure what format the ignoredNames should have - name + group as a concatenated string? A map between groups and names? |
@mudkiplex It would be the same thing except filtering by |
@jaredsburrows What I mean is that dependencies come as "group:name:version", and there might be several groups that have artifacts with the same name. So we could have:
If we were to just filter on name here we might accidentally filter out some dependencies that we want to keep. An alternative could be to work with exclusion patterns instead. That way we could let the user decide to filter on groups, names or entire artifacts. So instead of e.g this (The effect here would be that all artifacts are removed):
We could have either one of:
Does that make sense? |
Created a new PR for this here: #218 |
Fixes #116