Fix: builtIn defaults are not used when builtIn is not specified
This commit is contained in:
parent
241175dcc3
commit
d6d103262d
4 changed files with 18 additions and 11 deletions
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
Some content
|
||||
</root>
|
|
@ -62,18 +62,8 @@ namespace Microsoft.DotNet.ProjectModel.Files
|
|||
BuiltInsInclude = CreateCollection(
|
||||
sourceBasePath, "include", ExtractValues(builtIns.Value<JToken>("include")), literalPath: false);
|
||||
|
||||
if (defaultBuiltInInclude != null && !BuiltInsInclude.Any())
|
||||
{
|
||||
BuiltInsInclude = defaultBuiltInInclude.ToList();
|
||||
}
|
||||
|
||||
BuiltInsExclude = CreateCollection(
|
||||
sourceBasePath, "exclude", ExtractValues(builtIns.Value<JToken>("exclude")), literalPath: false);
|
||||
|
||||
if (defaultBuiltInExclude != null && !BuiltInsExclude.Any())
|
||||
{
|
||||
BuiltInsExclude = defaultBuiltInExclude.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
var mappings = token.Value<JToken>("mappings") as JObject;
|
||||
|
@ -94,6 +84,18 @@ namespace Microsoft.DotNet.ProjectModel.Files
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defaultBuiltInInclude != null &&
|
||||
(BuiltInsInclude == null || !BuiltInsInclude.Any()))
|
||||
{
|
||||
BuiltInsInclude = defaultBuiltInInclude.ToList();
|
||||
}
|
||||
|
||||
if (defaultBuiltInExclude != null &&
|
||||
(BuiltInsExclude == null || !BuiltInsExclude.Any()))
|
||||
{
|
||||
BuiltInsExclude = defaultBuiltInExclude.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public string SourceBasePath { get; }
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
|||
'buildOptions': {
|
||||
'compile': {
|
||||
'includeFiles': [ 'files/file1.cs', 'files/file2.cs' ],
|
||||
'exclude': 'files/*ex.cs'
|
||||
'exclude': '**/*.cs'
|
||||
}
|
||||
}}");
|
||||
|
||||
|
|
|
@ -166,6 +166,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
|
|||
var objDirInfo = new DirectoryInfo(Path.Combine(root, "obj", "Debug", DefaultFramework));
|
||||
objDirInfo.Should().HaveFile("EndToEndTestApp.resource1.resources");
|
||||
objDirInfo.Should().HaveFile("myresource.resources");
|
||||
objDirInfo.Should().HaveFile("EndToEndTestApp.defaultresource.resources");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
Loading…
Reference in a new issue