-
-
Notifications
You must be signed in to change notification settings - Fork 732
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
GH1184: Added support for manually including/excluding files for tools #1202
Conversation
patriksvensson
commented
Aug 30, 2016
•
edited
Loading
edited
- Query string should support multiple parameters with same name
- Add include/exclude parameter
- Better error messages
- Tests
{ | ||
foreach (var include in package.Parameters["include"]) | ||
{ | ||
collection.Add(_globber.GetFiles(include)); |
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 path
to include pattern.
@cake-build/team Ok, I think this is ready for review. |
Relates to #1184 |
@patriksvensson are you in a position to rebase this? And I can try to take a look tonight? |
@gep13 Sure, I will do this during the day. |
@gep13 Rebased |
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.
Overall, looks good to me, just one quick question.
[Theory] | ||
[InlineData("nuget:?package=Foo&include=/**/*.XML")] | ||
[InlineData("nuget:?package=Foo&include=**/*.XML")] | ||
[InlineData("nuget:?package=Foo&include=./**/*.XML")] |
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.
@patriksvensson I am assuming that the include/exclude is not case sensitive, right?
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.
Good question. Will add some tests 😄
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 include/exclude is case sensitive due to the globber. How should we proceed?
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.
We could change the interface for IGlobber
to take a PathComparer
and move the existing method to an extension method (that uses the default comparer). A breaking change, but something that would be useful in general. Or we could extend globbing to accept regex expressions, like here: https://en.wikipedia.org/wiki/Glob_(programming)
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.
@patriksvensson hmm, I think Regex might be over complicating it. I think I would prefer to add a breaking change, where the user can control the outcome, without having to dig into regex. @devlead thoughts?
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.
Yes, agree. I was hoping you would say that 😆
One thing we can do is to add a GlobSettings as the last parameter and start moving other glob-related things there. That would collect all those things at one place.
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'll say ship case sensitive. And if necessary break next release.
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.
@devlead I would be ok with that as well.
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.
@gep13 Rebased against upstream/develop. |
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.
LGTM :-)