mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
use msbuild variable for root namespace when available
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CompilerVisibleProperty Include="RootNamespace" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="confusables.txt" />
|
||||
<AdditionalFiles Include="confusables.txt" />
|
||||
|
||||
@@ -91,7 +91,8 @@ namespace SourceGenerators
|
||||
if (mapping.Count == 0)
|
||||
throw new InvalidOperationException("Empty confusable mapping source");
|
||||
|
||||
var ns = context.Compilation.AssemblyName;
|
||||
if (!context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.RootNamespace", out var ns))
|
||||
ns = context.Compilation.AssemblyName;
|
||||
var cn = Path.GetFileNameWithoutExtension(resourceName.Path);
|
||||
if (cn.Length == 1)
|
||||
cn = cn.ToUpper();
|
||||
@@ -100,7 +101,6 @@ namespace SourceGenerators
|
||||
if (!Version.TryParse(version, out _))
|
||||
version = "";
|
||||
|
||||
|
||||
var result = new StringBuilder()
|
||||
.AppendLine("using System;")
|
||||
.AppendLine("using System.Collections.Generic;")
|
||||
|
||||
Reference in New Issue
Block a user