-
Notifications
You must be signed in to change notification settings - Fork 228
Auto glob folder patterns in project.json #734
Conversation
project.SharedPatterns = GetSourcePattern(rawProject, "shared", _defaultSharedPatterns); | ||
project.ResourcesPatterns = GetSourcePattern(rawProject, "resources", _defaultResourcesPatterns); | ||
project.ContentsPatterns = GetSourcePattern(rawProject, "files", _defaultContentsPatterns); | ||
project.SourcePatterns = GetSourcePattern(rawProject, "code", _defaultSourcePatterns) |
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.
Instead of changing this code, I would make the implementation of GetSourcePattern do the right thing:
private IEnumerable<string> GetSourcePattern(Project project, JObject rawProject, string propertyName, string[] defaultPatterns)
{
return GetSourcePatternCore(rawProject, propertyName, defaultPatterns).Select(p => FolderToPattern(p, project.ProjectDirectory));
}
I think these tests are doing too much and we need tests for individual scenarios. |
Thanks for the feedbacks. Please check the follow-up commits. |
project.ContentsPatterns = GetSourcePattern(project, rawProject, "files", _defaultContentsPatterns); | ||
|
||
// 'webroot' should be excluded from compilation if specified | ||
if (!string.IsNullOrEmpty(project.WebRoot)) |
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.
Remove this logic completely, it's not part of the bug.
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.
Fixed
} | ||
} | ||
|
||
[Theory, MemberData("KrePaths")] |
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 don't usually use this pattern for attributes:
[Theory]
[MemberData("KrePaths")]
7eb3a50
to
fc75f6b
Compare
parent #670
Supplement to #727