Making the default exclude option empty, so that by default, we don't set any excludes for compile or embed during migration.

This commit is contained in:
Livar Cunha 2016-11-02 10:11:37 -07:00
parent 80ec02b4da
commit 0c833f5349
2 changed files with 6 additions and 4 deletions

View file

@ -130,6 +130,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
private Func<CommonCompilerOptions, string, IEnumerable<ProjectItemElement>> CopyToOutputFilesTransformExecute =>
(compilerOptions, projectDirectory) =>
CopyToOutputFilesTransform.Transform(GetCopyToOutputIncludeContext(compilerOptions, projectDirectory));
private readonly string[] DefaultEmptyExcludeOption = new string[0];
private readonly ProjectPropertyGroupElement _configurationPropertyGroup;
private readonly ProjectItemGroupElement _configurationItemGroup;
@ -328,7 +330,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
"compile",
new JObject(),
ProjectFilesCollection.DefaultCompileBuiltInPatterns,
ProjectFilesCollection.DefaultBuiltInExcludePatterns);
DefaultEmptyExcludeOption);
}
private IncludeContext GetEmbedIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)
@ -340,7 +342,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
"embed",
new JObject(),
ProjectFilesCollection.DefaultResourcesBuiltInPatterns,
ProjectFilesCollection.DefaultBuiltInExcludePatterns);
DefaultEmptyExcludeOption);
}
private IncludeContext GetCopyToOutputIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)

View file

@ -58,9 +58,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
mockProj.Items.Count().Should().Be(2);
mockProj.Items.First(i => i.ItemType == "Compile").Include.Should().Be(@"**\*.cs");
mockProj.Items.First(i => i.ItemType == "Compile").Exclude.Should().Be(@"bin\**;obj\**;**\*.xproj;packages\**");
mockProj.Items.First(i => i.ItemType == "Compile").Exclude.Should().BeEmpty();
mockProj.Items.First(i => i.ItemType == "EmbeddedResource").Include.Should().Be(@"compiler\resources\**\*;**\*.resx");
mockProj.Items.First(i => i.ItemType == "EmbeddedResource").Exclude.Should().Be(@"bin\**;obj\**;**\*.xproj;packages\**");
mockProj.Items.First(i => i.ItemType == "EmbeddedResource").Exclude.Should().BeEmpty();
}
[Fact]