H.Generators.Tests.Extensions
1.23.0
See the version list below for details.
dotnet add package H.Generators.Tests.Extensions --version 1.23.0
NuGet\Install-Package H.Generators.Tests.Extensions -Version 1.23.0
<PackageReference Include="H.Generators.Tests.Extensions" Version="1.23.0" />
paket add H.Generators.Tests.Extensions --version 1.23.0
#r "nuget: H.Generators.Tests.Extensions, 1.23.0"
// Install H.Generators.Tests.Extensions as a Cake Addin #addin nuget:?package=H.Generators.Tests.Extensions&version=1.23.0 // Install H.Generators.Tests.Extensions as a Cake Tool #tool nuget:?package=H.Generators.Tests.Extensions&version=1.23.0
H.Generators.Extensions
A set of extensions to simplify the code of generators. In addition to extensions, this library also adds a .props file to automatically add your generation-time dependencies to the NuGet package and Integration tests.
Install
The usage is pretty simple:
<PackageReference Include="H.Generators.Extensions" Version="1.4.2" PrivateAssets="all" />
I want to note that PrivateAssets="all" is required to rule out some issues.
Extensions
AnalyzerConfigOptionsProviderExtensions
options.GetGlobalOption(string name)
options.GetOption(AdditionalText, string name)
options.GetRequiredGlobalOption(string name)
options.GetRequiredOption(AdditionalText, string name)
options.TryRecognizeFramework()
options.RecognizeFramework()
To recognize the framework, you will need to add the following code to your %PackageId%.props:
<Project>
<ItemGroup>
<CompilerVisibleProperty Include="RecognizeFramework_DefineConstants"/>
<CompilerVisibleProperty Include="UseWPF"/>
<CompilerVisibleProperty Include="UseWinUI"/>
<CompilerVisibleProperty Include="UseMaui"/>
</ItemGroup>
<Target Name="CreateDefineConstants" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun;GenerateMSBuildEditorConfigFileCore">
<PropertyGroup>
<RecognizeFramework_DefineConstants>$(DefineConstants.Replace(';',','))</RecognizeFramework_DefineConstants>
</PropertyGroup>
</Target>
</Project>
SourceProductionContextExtensions
context.ReportException(string id, Exception)
StringExtensions
name.ToPropertyName()
name.ToParameterName()
text.RemoveBlankLinesWhereOnlyWhitespaces()
text.NormalizeLineEndings(string? newLine = null)
fullTypeName.ExtractNamespace()
fullTypeName.ExtractSimpleName()
fullTypeName.WithGlobalPrefix()
EnumerableExtensions
values.Inject()
H.Generators.Tests.Extensions
DictionaryAnalyzerConfigOptions
DictionaryAnalyzerConfigOptionsProvider
MemoryAdditionalText
ImmutableArrayExtensions.NormalizeLocations
Support
You can get answers to your questions in my discord support channel:
https://discord.gg/g8u2t9dKgE
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.Common (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing (>= 1.1.2)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.8.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 4.8.0)
-
net6.0
- Microsoft.CodeAnalysis.Common (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing (>= 1.1.2)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.8.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 4.8.0)
-
net7.0
- Microsoft.CodeAnalysis.Common (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing (>= 1.1.2)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.8.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 4.8.0)
-
net8.0
- Microsoft.CodeAnalysis.Common (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing (>= 1.1.2)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.8.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 4.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on H.Generators.Tests.Extensions:
Repository | Stars |
---|---|
HavenDV/DependencyPropertyGenerator
Dependency property, routed event and weak event source generator for WPF/UWP/WinUI/Uno/Avalonia/MAUI platforms.
|
Version | Downloads | Last updated |
---|---|---|
1.24.0 | 314 | 11/13/2024 |
1.23.0 | 78 | 11/13/2024 |
1.22.0 | 4,054 | 11/30/2023 |
1.21.1 | 126 | 11/30/2023 |
1.21.0 | 136 | 11/30/2023 |
1.20.0 | 1,042 | 11/7/2023 |
1.19.0 | 274 | 9/22/2023 |
1.18.0 | 175 | 8/30/2023 |
1.17.1 | 149 | 8/30/2023 |
1.17.0 | 143 | 8/30/2023 |
1.16.0 | 140 | 8/16/2023 |
1.15.1 | 219 | 4/8/2023 |
1.15.0 | 352 | 3/10/2023 |
1.14.3 | 220 | 3/9/2023 |
1.14.2 | 225 | 3/9/2023 |
1.14.1 | 225 | 3/9/2023 |
1.14.0 | 232 | 3/9/2023 |
1.13.1 | 231 | 3/9/2023 |
1.13.0 | 214 | 3/9/2023 |
1.12.0 | 205 | 3/8/2023 |
1.11.0 | 225 | 3/6/2023 |
1.10.2 | 219 | 3/6/2023 |
1.10.1 | 238 | 3/6/2023 |
1.10.0 | 232 | 3/5/2023 |
1.9.2 | 236 | 2/16/2023 |
1.9.1 | 261 | 2/6/2023 |
1.9.0 | 250 | 2/6/2023 |
1.8.4 | 330 | 1/4/2023 |
1.8.3 | 318 | 11/19/2022 |
1.8.2 | 342 | 11/12/2022 |
1.8.1 | 335 | 11/1/2022 |
1.8.0 | 344 | 11/1/2022 |
1.7.7 | 416 | 8/1/2022 |
1.7.6 | 432 | 7/19/2022 |
1.7.5 | 445 | 7/17/2022 |
1.7.4 | 423 | 7/13/2022 |
1.7.3 | 422 | 7/13/2022 |
1.7.2 | 428 | 7/13/2022 |
1.7.1 | 425 | 7/13/2022 |
1.7.0 | 547 | 7/9/2022 |
1.6.0 | 435 | 7/8/2022 |
1.5.0 | 436 | 6/23/2022 |
1.4.2 | 468 | 6/22/2022 |
1.4.1 | 411 | 6/22/2022 |
1.4.0 | 431 | 6/22/2022 |
1.3.0 | 446 | 6/21/2022 |
1.0.20 | 435 | 6/1/2022 |
1.0.19 | 423 | 6/1/2022 |
1.0.18 | 418 | 5/31/2022 |
1.0.17 | 410 | 5/31/2022 |
1.0.16 | 416 | 5/31/2022 |
1.0.15 | 413 | 5/31/2022 |
1.0.14 | 417 | 5/31/2022 |
1.0.13 | 435 | 5/25/2022 |
1.0.12 | 414 | 5/25/2022 |
1.0.11 | 411 | 5/25/2022 |
1.0.10 | 426 | 5/25/2022 |
1.0.9 | 409 | 5/25/2022 |
1.0.8 | 413 | 5/25/2022 |
1.0.0 | 417 | 6/6/2022 |
⭐ Last 10 features:
Added Net9 to LatestReferenceAssemblies.
Added extensions from DependencyPropertyGenerator.
Updated to net8.0.
Added net8.0 support for ReferenceAssemblies.
Updated Uno version in FrameworkReferenceAssemblies.
Added GeneratorDriverExtensions.
Added net7.0 reference assemblies.
Added SelectAndReportDiagnostics.
Added IncrementalValuesProvider.CollectAsEquatableArray.
Simplified framework detection and exclude dynamic names.
🐞 Last 10 fixes:
Updated Uno and WinAppSdk versions.
Fixed Avalonia ReferenceAssemblies.
Fixed warnings.
Added ability to add/remove _SystemLibs.
Added missing IncrementalValueProvider SelectAndReportExceptions without cancellation token.
Added IncrementalValueProvider SelectAndReportExceptions.
Added missing useful overloads.
Added IncrementalValuesProviderExtensions.WhereNotNull.
Simplified ImmutableArrayExtensions.
Removed deprecated SourceProductionContextExtensions.AddTextSource.