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

GH1184: Added support for manually including/excluding files for tools #1202

Merged
merged 1 commit into from
Sep 15, 2016
Merged

GH1184: Added support for manually including/excluding files for tools #1202

merged 1 commit into from
Sep 15, 2016

Conversation

patriksvensson
Copy link
Member

@patriksvensson patriksvensson commented Aug 30, 2016

  • 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));
Copy link
Member Author

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.

@patriksvensson patriksvensson changed the title [WIP] GH1184: Added support for manually including/excluding files for tools GH1184: Added support for manually including/excluding files for tools Sep 7, 2016
@patriksvensson
Copy link
Member Author

@cake-build/team Ok, I think this is ready for review.

@gep13
Copy link
Member

gep13 commented Sep 14, 2016

Relates to #1184

@gep13
Copy link
Member

gep13 commented Sep 14, 2016

@patriksvensson are you in a position to rebase this? And I can try to take a look tonight?

@patriksvensson
Copy link
Member Author

@gep13 Sure, I will do this during the day.

@patriksvensson
Copy link
Member Author

@gep13 Rebased

Copy link
Member

@gep13 gep13 left a 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")]
Copy link
Member

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?

Copy link
Member Author

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 😄

Copy link
Member Author

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?

Copy link
Member Author

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)

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

@devlead @gep13 Ok, sounds good to me 😄

@patriksvensson
Copy link
Member Author

@gep13 Rebased against upstream/develop.

Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM :-)

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.

4 participants