H.Generators.Extensions
1.7.5
See the version list below for details.
dotnet add package H.Generators.Extensions --version 1.7.5
NuGet\Install-Package H.Generators.Extensions -Version 1.7.5
<PackageReference Include="H.Generators.Extensions" Version="1.7.5" />
paket add H.Generators.Extensions --version 1.7.5
#r "nuget: H.Generators.Extensions, 1.7.5"
// Install H.Generators.Extensions as a Cake Addin #addin nuget:?package=H.Generators.Extensions&version=1.7.5 // Install H.Generators.Extensions as a Cake Tool #tool nuget:?package=H.Generators.Extensions&version=1.7.5
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
DictionaryAnalyzerConfigOptions
DictionaryAnalyzerConfigOptionsProvider
MemoryAdditionalText
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. |
.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 (1)
Showing the top 1 NuGet packages that depend on H.Generators.Extensions:
Package | Downloads |
---|---|
WPF.DependencyPropertyGenerator
C# Source Generator library to generate DependencyProperty. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on H.Generators.Extensions:
Repository | Stars |
---|---|
christianhelle/refitter
A tool for generating Refit interfaces and contracts from OpenAPI specifications
|
|
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 | 482 | 11/13/2024 |
1.23.0 | 65 | 11/13/2024 |
1.22.0 | 10,380 | 11/30/2023 |
1.21.1 | 111 | 11/30/2023 |
1.21.0 | 126 | 11/30/2023 |
1.20.0 | 2,105 | 11/7/2023 |
1.19.0 | 1,351 | 9/22/2023 |
1.18.0 | 1,633 | 8/30/2023 |
1.17.1 | 144 | 8/30/2023 |
1.17.0 | 142 | 8/30/2023 |
1.16.0 | 1,131 | 8/16/2023 |
1.15.1 | 1,381 | 4/8/2023 |
1.15.0 | 323 | 3/10/2023 |
1.14.3 | 224 | 3/9/2023 |
1.14.2 | 333 | 3/9/2023 |
1.14.1 | 265 | 3/9/2023 |
1.14.0 | 200 | 3/9/2023 |
1.13.1 | 200 | 3/9/2023 |
1.13.0 | 203 | 3/9/2023 |
1.12.0 | 216 | 3/8/2023 |
1.11.0 | 1,771 | 3/6/2023 |
1.10.2 | 222 | 3/6/2023 |
1.10.1 | 225 | 3/6/2023 |
1.10.0 | 226 | 3/5/2023 |
1.9.2 | 635 | 2/16/2023 |
1.9.1 | 461 | 2/6/2023 |
1.9.0 | 242 | 2/6/2023 |
1.8.4 | 375 | 1/4/2023 |
1.8.3 | 783 | 11/19/2022 |
1.8.2 | 319 | 11/12/2022 |
1.8.1 | 955 | 11/1/2022 |
1.8.0 | 336 | 11/1/2022 |
1.7.7 | 6,931 | 8/1/2022 |
1.7.6 | 479 | 7/19/2022 |
1.7.5 | 859 | 7/17/2022 |
1.7.4 | 416 | 7/13/2022 |
1.7.3 | 397 | 7/13/2022 |
1.7.2 | 444 | 7/13/2022 |
1.7.1 | 442 | 7/13/2022 |
1.7.0 | 443 | 7/9/2022 |
1.6.0 | 577 | 7/8/2022 |
1.5.0 | 449 | 6/23/2022 |
1.4.2 | 794 | 6/22/2022 |
1.4.1 | 428 | 6/22/2022 |
1.4.0 | 431 | 6/22/2022 |
1.3.0 | 419 | 6/21/2022 |
1.2.0 | 453 | 6/6/2022 |
1.1.0 | 405 | 6/6/2022 |
1.0.20 | 415 | 6/1/2022 |
1.0.19 | 411 | 6/1/2022 |
1.0.18 | 418 | 5/31/2022 |
1.0.17 | 423 | 5/31/2022 |
1.0.16 | 394 | 5/31/2022 |
1.0.15 | 393 | 5/31/2022 |
1.0.14 | 411 | 5/31/2022 |
1.0.13 | 412 | 5/25/2022 |
1.0.12 | 402 | 5/25/2022 |
1.0.11 | 411 | 5/25/2022 |
1.0.10 | 400 | 5/25/2022 |
1.0.9 | 404 | 5/25/2022 |
1.0.8 | 410 | 5/25/2022 |
1.0.7 | 410 | 5/24/2022 |
1.0.6 | 408 | 5/20/2022 |
1.0.5 | 436 | 5/18/2022 |
1.0.4 | 413 | 5/18/2022 |
1.0.3 | 409 | 5/18/2022 |
1.0.2 | 430 | 5/18/2022 |
1.0.1 | 438 | 5/18/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:
EnumerableExtensions.Inject will return " " for empty collections.
Fixed netstandard check.
Fixed netstandard check 2.
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.