Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Auto glob folder patterns in project.json #734

Merged
merged 1 commit into from
Oct 13, 2014

Conversation

ChengTian
Copy link
Contributor

parent #670

Supplement to #727

project.SharedPatterns = GetSourcePattern(rawProject, "shared", _defaultSharedPatterns);
project.ResourcesPatterns = GetSourcePattern(rawProject, "resources", _defaultResourcesPatterns);
project.ContentsPatterns = GetSourcePattern(rawProject, "files", _defaultContentsPatterns);
project.SourcePatterns = GetSourcePattern(rawProject, "code", _defaultSourcePatterns)
Copy link
Member

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));
}

@davidfowl
Copy link
Member

I think these tests are doing too much and we need tests for individual scenarios.

@ChengTian
Copy link
Contributor Author

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@davidfowl
Copy link
Member

:shipit:

}
}

[Theory, MemberData("KrePaths")]
Copy link
Member

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")]

@davidfowl
Copy link
Member

:shipit:

@ChengTian ChengTian force-pushed the auto-glob-folder-patterns-in-project.json branch from 7eb3a50 to fc75f6b Compare October 13, 2014 23:30
@ChengTian ChengTian merged commit fc75f6b into dev Oct 13, 2014
@ChengTian ChengTian deleted the auto-glob-folder-patterns-in-project.json branch October 13, 2014 23:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants