mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-04-09 19:41:37 +00:00
Fixed source generator (#724)
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,deb,updater, appimage,deb) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,deb,updater, appimage,deb) (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,deb,updater, appimage,deb) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,deb,updater, appimage,deb) (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
This commit is contained in:
parent
3cef689c83
commit
a65291c5eb
@ -60,21 +60,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SharedTools\SharedTools.csproj" />
|
<ProjectReference Include="..\SharedTools\SharedTools.csproj" />
|
||||||
<ProjectReference Include="..\SourceCodeRules\SourceCodeRules\SourceCodeRules.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
<ProjectReference Include="..\SourceCodeRules\SourceCodeRules\SourceCodeRules.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||||
|
<ProjectReference Include="..\SourceGeneratedMappings\SourceGeneratedMappings.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<SourceGeneratedMappingsProject>..\SourceGeneratedMappings\SourceGeneratedMappings.csproj</SourceGeneratedMappingsProject>
|
|
||||||
<SourceGeneratedMappingsAssembly>..\SourceGeneratedMappings\bin\$(Configuration)\net9.0\SourceGeneratedMappings.dll</SourceGeneratedMappingsAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Target Name="BuildSourceGeneratedMappings" BeforeTargets="CoreCompile">
|
|
||||||
<MSBuild Projects="$(SourceGeneratedMappingsProject)" Targets="Restore;Build" Properties="Configuration=$(Configuration);RestoreIgnoreFailedSources=true" />
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Analyzer Include="$(SourceGeneratedMappingsAssembly)" Condition="Exists('$(SourceGeneratedMappingsAssembly)')" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Plugins\assistants\assets\" />
|
<Folder Include="Plugins\assistants\assets\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@ -235,6 +235,6 @@
|
|||||||
"type": "Project"
|
"type": "Project"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"net9.0/win-x64": {}
|
"net9.0/osx-arm64": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
8
app/SourceGeneratedMappings/AnalyzerReleases.Shipped.md
Normal file
8
app/SourceGeneratedMappings/AnalyzerReleases.Shipped.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
## Release 1.0
|
||||||
|
|
||||||
|
### New Rules
|
||||||
|
|
||||||
|
Rule ID | Category | Severity | Notes
|
||||||
|
---------|------------------|----------|--------------------------
|
||||||
|
MBI001 | SourceGeneration | Info | MappingRegistryGenerator
|
||||||
|
MBI002 | SourceGeneration | Warning | MappingRegistryGenerator
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
; Unshipped analyzer release
|
||||||
|
; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md
|
||||||
|
|
||||||
|
### New Rules
|
||||||
@ -9,7 +9,9 @@ using Microsoft.CodeAnalysis.Text;
|
|||||||
namespace SourceGeneratedMappings;
|
namespace SourceGeneratedMappings;
|
||||||
|
|
||||||
[Generator]
|
[Generator]
|
||||||
|
#pragma warning disable RS1036
|
||||||
public sealed class MappingRegistryGenerator : IIncrementalGenerator
|
public sealed class MappingRegistryGenerator : IIncrementalGenerator
|
||||||
|
#pragma warning restore RS1036
|
||||||
{
|
{
|
||||||
private const string GENERATED_NAMESPACE = "AIStudio.Tools.PluginSystem.Assistants.Icons";
|
private const string GENERATED_NAMESPACE = "AIStudio.Tools.PluginSystem.Assistants.Icons";
|
||||||
private const string ROOT_TYPE_NAME = "MudBlazor.Icons";
|
private const string ROOT_TYPE_NAME = "MudBlazor.Icons";
|
||||||
@ -26,7 +28,7 @@ public sealed class MappingRegistryGenerator : IIncrementalGenerator
|
|||||||
private static readonly DiagnosticDescriptor NO_ICONS_FOUND = new(
|
private static readonly DiagnosticDescriptor NO_ICONS_FOUND = new(
|
||||||
id: "MBI002",
|
id: "MBI002",
|
||||||
title: "No MudBlazor icons were discovered",
|
title: "No MudBlazor icons were discovered",
|
||||||
messageFormat: "The generator found '{0}', but no nested icon constants were discovered below it.",
|
messageFormat: "The generator found '{0}', but no nested icon constants were discovered below it",
|
||||||
category: "SourceGeneration",
|
category: "SourceGeneration",
|
||||||
DiagnosticSeverity.Warning,
|
DiagnosticSeverity.Warning,
|
||||||
isEnabledByDefault: true);
|
isEnabledByDefault: true);
|
||||||
@ -80,8 +82,8 @@ public sealed class MappingRegistryGenerator : IIncrementalGenerator
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
icons.Add(new IconDefinition(
|
icons.Add(new IconDefinition(
|
||||||
QualifiedName: $"Icons.{groupPath}.{field.Name}",
|
$"Icons.{groupPath}.{field.Name}",
|
||||||
Svg: svg));
|
svg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,5 +128,10 @@ public sealed class MappingRegistryGenerator : IIncrementalGenerator
|
|||||||
return Microsoft.CodeAnalysis.CSharp.SymbolDisplay.FormatLiteral(value, quote: true);
|
return Microsoft.CodeAnalysis.CSharp.SymbolDisplay.FormatLiteral(value, quote: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed record IconDefinition(string QualifiedName, string Svg);
|
private sealed class IconDefinition(string qualifiedName, string svg)
|
||||||
|
{
|
||||||
|
public string QualifiedName { get; } = qualifiedName;
|
||||||
|
|
||||||
|
public string Svg { get; } = svg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
@ -16,14 +16,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.CodeAnalysis">
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
|
||||||
<HintPath>$(MSBuildSDKsPath)\..\Roslyn\bincore\Microsoft.CodeAnalysis.dll</HintPath>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<Private>false</Private>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</Reference>
|
</PackageReference>
|
||||||
<Reference Include="Microsoft.CodeAnalysis.CSharp">
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
|
||||||
<HintPath>$(MSBuildSDKsPath)\..\Roslyn\bincore\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user