diff --git a/src/Directory.props b/src/Directory.props
index ea61fb05..b0630fe3 100644
--- a/src/Directory.props
+++ b/src/Directory.props
@@ -6,6 +6,7 @@
true
analyzers/dotnet/cs
false
+ https://api.nuget.org/v3/index.json
$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\nugetizer\bin'));$(RestoreSources)
https://clarius.org/ThisAssembly
diff --git a/src/ThisAssembly.Resources/ResourcesGenerator.cs b/src/ThisAssembly.Resources/ResourcesGenerator.cs
index ea1e3d60..adc6a661 100644
--- a/src/ThisAssembly.Resources/ResourcesGenerator.cs
+++ b/src/ThisAssembly.Resources/ResourcesGenerator.cs
@@ -1,5 +1,5 @@
using System;
-using System.Collections.Immutable;
+using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
@@ -35,8 +35,11 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
.Combine(context.AnalyzerConfigOptionsProvider
.Select((p, _) =>
{
- p.GlobalOptions.TryGetValue("build_property.EmbeddedResourceStringExtensions", out var extensions);
- return extensions!;
+ if (!p.GlobalOptions.TryGetValue("build_property.EmbeddedResourceStringExtensions", out var extensions) ||
+ extensions == null)
+ return new HashSet();
+
+ return new HashSet(extensions.Split('|'), StringComparer.OrdinalIgnoreCase);
}));
context.RegisterSourceOutput(
@@ -44,15 +47,15 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
GenerateSource);
}
- static void GenerateSource(SourceProductionContext spc, ((string resourceName, string? kind, string? comment), string extensions) arg2)
+ static void GenerateSource(SourceProductionContext spc, ((string resourceName, string? kind, string? comment), HashSet extensions) arg2)
{
var ((resourceName, kind, comment), extensions) = arg2;
var file = "CSharp.sbntxt";
var template = Template.Parse(EmbeddedResource.GetContent(file), file);
- var isText = kind != null && kind.Equals("text", StringComparison.OrdinalIgnoreCase)
- || extensions.Split(';').Contains(Path.GetFileName(resourceName));
+ var isText = kind?.Equals("text", StringComparison.OrdinalIgnoreCase) == true ||
+ extensions.Contains(Path.GetExtension(resourceName));
var root = Area.Load(new Resource(resourceName, comment, isText));
var model = new Model(root);
diff --git a/src/ThisAssembly.Resources/ThisAssembly.Resources.props b/src/ThisAssembly.Resources/ThisAssembly.Resources.props
index d4a06db1..2107582d 100644
--- a/src/ThisAssembly.Resources/ThisAssembly.Resources.props
+++ b/src/ThisAssembly.Resources/ThisAssembly.Resources.props
@@ -1,7 +1,7 @@
- .txt;.cs;.sql;.json;.md;
+ .txt|.cs|.sql|.json|.md;