H.Generators.Tests.Extensions
1.7.2
See the version list below for details.
dotnet add package H.Generators.Tests.Extensions --version 1.7.2
NuGet\Install-Package H.Generators.Tests.Extensions -Version 1.7.2
<PackageReference Include="H.Generators.Tests.Extensions" Version="1.7.2" />
<PackageVersion Include="H.Generators.Tests.Extensions" Version="1.7.2" />
<PackageReference Include="H.Generators.Tests.Extensions" />
paket add H.Generators.Tests.Extensions --version 1.7.2
#r "nuget: H.Generators.Tests.Extensions, 1.7.2"
#:package H.Generators.Tests.Extensions@1.7.2
#addin nuget:?package=H.Generators.Tests.Extensions&version=1.7.2
#tool nuget:?package=H.Generators.Tests.Extensions&version=1.7.2
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.TryRecognizePlatform(string prefix)options.RecognizePlatform(string prefix)To recognize the platform, you will need to add the following code to your %PackageId%.props(In this case, the passed prefix will be equal to %PackageId%):
<Project>
<ItemGroup>
<CompilerVisibleProperty Include="%PackageId%_DefineConstants"/>
<CompilerVisibleProperty Include="UseWPF"/>
<CompilerVisibleProperty Include="UseWinUI"/>
<CompilerVisibleProperty Include="UseMaui"/>
</ItemGroup>
<Target Name="CreateDefineConstants" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun;GenerateMSBuildEditorConfigFileCore">
<PropertyGroup>
<%PackageId%_DefineConstants>$(DefineConstants.Replace(';',','))</%PackageId%_DefineConstants>
</PropertyGroup>
</Target>
</Project>
SourceProductionContextExtensions
context.AddTextSource(string hintName, string text)context.ReportException(string id, Exception)
StringExtensions
name.ToPropertyName()name.ToParameterName()text.RemoveBlankLinesWhereOnlyWhitespaces()fullTypeName.ExtractNamespace()fullTypeName.ExtractSimpleName()fullTypeName.WithGlobalPrefix()
EnumerableExtensions
values.Inject()
H.Generators.Tests.Extensions
DictionaryAnalyzerConfigOptionsDictionaryAnalyzerConfigOptionsProviderMemoryAdditionalText
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 was computed. 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 was computed. 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 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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.0.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.2 | 2,870 | 2/26/2025 |
| 1.24.1 | 852 | 1/12/2025 |
| 1.24.0 | 933 | 11/13/2024 |
| 1.23.0 | 231 | 11/13/2024 |
| 1.22.0 | 4,263 | 11/30/2023 |
| 1.21.1 | 196 | 11/30/2023 |
| 1.21.0 | 217 | 11/30/2023 |
| 1.20.0 | 1,162 | 11/7/2023 |
| 1.19.0 | 828 | 9/22/2023 |
| 1.18.0 | 275 | 8/30/2023 |
| 1.17.1 | 285 | 8/30/2023 |
| 1.17.0 | 239 | 8/30/2023 |
| 1.16.0 | 231 | 8/16/2023 |
| 1.15.1 | 365 | 4/8/2023 |
| 1.15.0 | 506 | 3/10/2023 |
| 1.14.3 | 352 | 3/9/2023 |
| 1.14.2 | 356 | 3/9/2023 |
| 1.14.1 | 351 | 3/9/2023 |
| 1.14.0 | 355 | 3/9/2023 |
| 1.7.2 | 576 | 7/13/2022 |
⭐ Last 10 features:
Added MAUI recognize support.
Added RecognizePlatform extensions.
Added AnalyzerConfigOptionsProviderExtensions.IsDesignTime.
Added fullTypeName StringExtensions.
Added StringExtensions.RemoveBlankLinesWhereOnlyWhitespaces().
Updated ConventionalCommitsGitInfo.
To ConventionalCommitsGitInfo.
Added _SystemLibsProperty null check.
Added .Net standard 1.6 dependencies to system libs.
To predefined list of system libs.
🐞 Last 10 bug fixes:
Fixed netstandard check for system libs.
Replaced Microsoft.CodeAnalysis.CSharp.Workspaces to Microsoft.CodeAnalysis.Common.
Removed AfterTargets.
Try solution with DependsOnTargets="ResolveReferences".
Added _ResolvedCompileFileDefinitions check.
Fixed TargetPathWithTargetPlatformMoniker net standard 1.x bug.
Fixed latest commit.
Fixed bug with NetStandard 1.x dependencies.
Removed empty MSBuild messages.
Fixed namespaces.