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:
parent
80ec02b4da
commit
0c833f5349
2 changed files with 6 additions and 4 deletions
|
@ -130,6 +130,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
private Func<CommonCompilerOptions, string, IEnumerable<ProjectItemElement>> CopyToOutputFilesTransformExecute =>
|
private Func<CommonCompilerOptions, string, IEnumerable<ProjectItemElement>> CopyToOutputFilesTransformExecute =>
|
||||||
(compilerOptions, projectDirectory) =>
|
(compilerOptions, projectDirectory) =>
|
||||||
CopyToOutputFilesTransform.Transform(GetCopyToOutputIncludeContext(compilerOptions, projectDirectory));
|
CopyToOutputFilesTransform.Transform(GetCopyToOutputIncludeContext(compilerOptions, projectDirectory));
|
||||||
|
|
||||||
|
private readonly string[] DefaultEmptyExcludeOption = new string[0];
|
||||||
|
|
||||||
private readonly ProjectPropertyGroupElement _configurationPropertyGroup;
|
private readonly ProjectPropertyGroupElement _configurationPropertyGroup;
|
||||||
private readonly ProjectItemGroupElement _configurationItemGroup;
|
private readonly ProjectItemGroupElement _configurationItemGroup;
|
||||||
|
@ -328,7 +330,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
"compile",
|
"compile",
|
||||||
new JObject(),
|
new JObject(),
|
||||||
ProjectFilesCollection.DefaultCompileBuiltInPatterns,
|
ProjectFilesCollection.DefaultCompileBuiltInPatterns,
|
||||||
ProjectFilesCollection.DefaultBuiltInExcludePatterns);
|
DefaultEmptyExcludeOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IncludeContext GetEmbedIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)
|
private IncludeContext GetEmbedIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)
|
||||||
|
@ -340,7 +342,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
"embed",
|
"embed",
|
||||||
new JObject(),
|
new JObject(),
|
||||||
ProjectFilesCollection.DefaultResourcesBuiltInPatterns,
|
ProjectFilesCollection.DefaultResourcesBuiltInPatterns,
|
||||||
ProjectFilesCollection.DefaultBuiltInExcludePatterns);
|
DefaultEmptyExcludeOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IncludeContext GetCopyToOutputIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)
|
private IncludeContext GetCopyToOutputIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory)
|
||||||
|
|
|
@ -58,9 +58,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
|
|
||||||
mockProj.Items.Count().Should().Be(2);
|
mockProj.Items.Count().Should().Be(2);
|
||||||
mockProj.Items.First(i => i.ItemType == "Compile").Include.Should().Be(@"**\*.cs");
|
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").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]
|
[Fact]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue