H.Generators.Tests.Extensions
1.10.0
See the version list below for details.
dotnet add package H.Generators.Tests.Extensions --version 1.10.0
NuGet\Install-Package H.Generators.Tests.Extensions -Version 1.10.0
<PackageReference Include="H.Generators.Tests.Extensions" Version="1.10.0" />
paket add H.Generators.Tests.Extensions --version 1.10.0
#r "nuget: H.Generators.Tests.Extensions, 1.10.0"
// Install H.Generators.Tests.Extensions as a Cake Addin #addin nuget:?package=H.Generators.Tests.Extensions&version=1.10.0 // Install H.Generators.Tests.Extensions as a Cake Tool #tool nuget:?package=H.Generators.Tests.Extensions&version=1.10.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.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()
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 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
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 | 294 | 11/13/2024 |
1.23.0 | 76 | 11/13/2024 |
1.22.0 | 4,052 | 11/30/2023 |
1.21.1 | 124 | 11/30/2023 |
1.21.0 | 134 | 11/30/2023 |
1.20.0 | 1,040 | 11/7/2023 |
1.19.0 | 272 | 9/22/2023 |
1.18.0 | 173 | 8/30/2023 |
1.17.1 | 147 | 8/30/2023 |
1.17.0 | 141 | 8/30/2023 |
1.16.0 | 138 | 8/16/2023 |
1.15.1 | 217 | 4/8/2023 |
1.15.0 | 350 | 3/10/2023 |
1.14.3 | 218 | 3/9/2023 |
1.14.2 | 223 | 3/9/2023 |
1.14.1 | 223 | 3/9/2023 |
1.14.0 | 230 | 3/9/2023 |
1.13.1 | 229 | 3/9/2023 |
1.13.0 | 212 | 3/9/2023 |
1.12.0 | 203 | 3/8/2023 |
1.11.0 | 223 | 3/6/2023 |
1.10.2 | 217 | 3/6/2023 |
1.10.1 | 236 | 3/6/2023 |
1.10.0 | 230 | 3/5/2023 |
1.9.2 | 234 | 2/16/2023 |
1.9.1 | 259 | 2/6/2023 |
1.9.0 | 248 | 2/6/2023 |
1.8.4 | 328 | 1/4/2023 |
1.8.3 | 316 | 11/19/2022 |
1.8.2 | 340 | 11/12/2022 |
1.8.1 | 333 | 11/1/2022 |
1.8.0 | 342 | 11/1/2022 |
1.7.7 | 414 | 8/1/2022 |
1.7.6 | 430 | 7/19/2022 |
1.7.5 | 443 | 7/17/2022 |
1.7.4 | 421 | 7/13/2022 |
1.7.3 | 420 | 7/13/2022 |
1.7.2 | 426 | 7/13/2022 |
1.7.1 | 423 | 7/13/2022 |
1.7.0 | 545 | 7/9/2022 |
1.6.0 | 433 | 7/8/2022 |
1.5.0 | 434 | 6/23/2022 |
1.4.2 | 466 | 6/22/2022 |
1.4.1 | 409 | 6/22/2022 |
1.4.0 | 429 | 6/22/2022 |
1.3.0 | 444 | 6/21/2022 |
1.0.20 | 433 | 6/1/2022 |
1.0.19 | 419 | 6/1/2022 |
1.0.18 | 416 | 5/31/2022 |
1.0.17 | 408 | 5/31/2022 |
1.0.16 | 414 | 5/31/2022 |
1.0.15 | 411 | 5/31/2022 |
1.0.14 | 415 | 5/31/2022 |
1.0.13 | 433 | 5/25/2022 |
1.0.12 | 412 | 5/25/2022 |
1.0.11 | 409 | 5/25/2022 |
1.0.10 | 424 | 5/25/2022 |
1.0.9 | 407 | 5/25/2022 |
1.0.8 | 411 | 5/25/2022 |
1.0.0 | 415 | 6/6/2022 |
⭐ Last 10 features:
Renamed Platform to Framework. Refactored.
Added ImmutableArrayExtensions.NormalizeLocations.
Do not output ref assemblies
Added MAUI recognize support.
Added RecognizePlatform extensions.
Added AnalyzerConfigOptionsProviderExtensions.IsDesignTime.
Added fullTypeName StringExtensions.
Added StringExtensions.RemoveBlankLinesWhereOnlyWhitespaces().
Updated ConventionalCommitsGitInfo.
To ConventionalCommitsGitInfo.
🐞 Last 10 bug fixes:
Add system component model and system runtime serialization formatters.
Fixed ImmutableArrayExtensions namespace.
Fixed StringExtensions.ToParameterName() to work for some keywords.
Fixed #3.
Refactored AnalyzerConfigOptionsProviderExtensions.cs.
Try to generate build numbers again.
Removed Net Standard 2.0 check as it seems not needed in dotnet 6.0.300+.
Fixed problem with RemoveBlankLinesWhereOnlyWhitespaces line endings.
EnumerableExtensions.Inject will return " " for empty collections.
Fixed netstandard check.