Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
Changelog
---

## [v1.0.0-beta20](https://github.com/andrewlock/NetEscapades.EnumGenerators/compare/v1.0.0-beta19..v1.0.0-beta20) (2026-01-05)

### Breaking Changes

* Split NetEscapades.EnumGenerators package into 3 packages (#233, #234)
* _NetEscapades.EnumGenerators_ is a meta package, and should not be added with `PrivateAssets="All"` or `ExcludeAssets="runtime"`
* _NetEscapades.EnumGenerators.Generators_ contains the source generator, and _can_ be added with private assets
* _NetEscapades.EnumGenerators.RuntimeDependencies_ contains optional runtime dependencies used during generation
* Please see the readme for advice on choosing your packages: https://github.com/andrewlock/NetEscapades.EnumGenerators#package-referencing-options

### Features

* Add analyzer to detect `StringBuilder.Append(enum)` on enums with `[EnumExtensions]` or `EnumExtensions<T>` (#230)

### Fixes

* Fix generating invalid XML in System.Memory warnings (#228)

## [v1.0.0-beta19](https://github.com/andrewlock/NetEscapades.EnumGenerators/compare/v1.0.0-beta18..v1.0.0-beta19) (2026-01-05)

### Fixes
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ This adds a `<PackageReference>` to your project:
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
<!-- -->

</Project>
Expand Down Expand Up @@ -390,10 +390,10 @@ In some cases you may not want these dependencies to flow to other projects. Thi
</PropertyGroup>

<!-- Add the generator package with PrivateAssets -->
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All"/>
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All"/>

<!-- Optionally add the runtime dependencies package -->
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta20" />
</Project>
```

Expand Down Expand Up @@ -453,7 +453,7 @@ In general, for simplicity, we recommend referencing [NetEscapades.EnumGenerator
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
</Project>
```

Expand All @@ -466,7 +466,7 @@ In contrast, if you are producing a reusable library and don't want any runtime
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All" ExcludeAssets="runtime" />
</Project>
```

Expand All @@ -480,8 +480,8 @@ The final option is to reference [NetEscapades.EnumGenerators.Generators](https:
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All" ExcludeAssets="runtime"/>
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All" ExcludeAssets="runtime"/>
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta20" />
</Project>
```

Expand Down Expand Up @@ -513,7 +513,7 @@ This adds a `<PackageReference>` to your project. You can additionally mark the
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators.Interceptors" Version="1.0.0-beta19"
<PackageReference Include="NetEscapades.EnumGenerators.Interceptors" Version="1.0.0-beta20"
PrivateAssets="all" ExcludeAssets="runtime" />
<!-- -->

Expand Down Expand Up @@ -567,7 +567,7 @@ Your project file should look something like this:
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
</Project>
```

Expand All @@ -588,7 +588,7 @@ If you wish to preserve these attributes in the build output, you can define the
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" PrivateAssets="all" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" PrivateAssets="all" />
<!-- ☝ You must not exclude the runtime assets in this case -->

</Project>
Expand Down
44 changes: 8 additions & 36 deletions releasenotes.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,23 @@
<PropertyGroup>
<PackageReleaseNotes>
<![CDATA[
## 1.0.0-beta19

### Fixes

* Fix README image links
## 1.0.0-beta20

### Breaking Changes

* Add support for generating `ReadOnlySpan<char>` based methods when System.Memory is present (#182, #212)
* Split NetEscapades.EnumGenerators package into 3 packages (#233, #234)
* _NetEscapades.EnumGenerators_ is a meta package, and should not be added with `PrivateAssets="All"` or `ExcludeAssets="runtime"`
* _NetEscapades.EnumGenerators.Generators_ contains the source generator, and _can_ be added with private assets
* _NetEscapades.EnumGenerators.RuntimeDependencies_ contains optional runtime dependencies used during generation
* Please see the readme for advice on choosing your packages: https://github.com/andrewlock/NetEscapades.EnumGenerators#package-referencing-options

### Features

* Add support for disabling number parsing using `EnumParseOptions` (#175)
* Add support for automatic `ToLowerInvariant` and `ToUpperInvariant` in `ToStringFast()`, using `SerializationOptions` (#177)
* Add Analyzers to encourage using the generated methods
* Add analyzer to detect ToString() on enums with [EnumExtensions] or EnumExtensions<T> (#196)
* Extend ToStringAnalyzer to detect enum usage in string interpolation (#198)
* Add analyzer to detect HasFlag() and suggest HasFlagFast() replacement (#199)
* Extract the extension class and namespace in analyzers (#200)
* Add using directive support to HasFlagAnalyzer and ToStringAnalyzer code fixes (#202)
* Add analyzer for Enum.IsDefined() suggesting generated IsDefined method (#203)
* Add analyzer for Enum.Parse() suggesting generated Parse method (NEEG007) (#204)
* Add analyzer for Enum.GetNames() with generated alternative (#209)
* Add analyzer for Enum.GetValues() with code fix to use generated method (#207)
* Add analyzer for Enum.GetValuesAsUnderlyingType() usage (#208)
* Add analyzer for Enum.TryParse() usage (#206)
* Refactor analyzers to reduce some duplication (#205)
* Disable usage analyzers by default, enable via editorconfig (#214)
* Update default severity to warning (#218)
* Change how the usage analyzers are enabled to use an `EnumGenerator_EnableUsageAnalyzers` MSBuild property instead (#222)
* Add AnalyzerTests project to confirm that the analyzers are actually triggering warnings in a real project (#223)
* Mention globalconfig in the docs, and tweak the detection for consistency (#224)
* Add analyzer to detect `StringBuilder.Append(enum)` on enums with `[EnumExtensions]` or `EnumExtensions<T>` (#230)

### Fixes

* Remove ToStringFastWithMetadata when it's not needed for perf reasons(#176)
* Minor performance fixes in generated code (#178)
* Use Collection expressions in generated code if possible (#179)

### Misc

* Build tweaks (#180)
* Add support for .NET 10.0 in Benchmark project (#184) Thanks [@HakamFostok](https://github.com/HakamFostok)!
* Add Usage Analyzers documentation to README (#216)
* Update Readme (#219)
* Fix generating invalid XML in System.Memory warnings (#228)

]]>
</PackageReleaseNotes>
Expand Down
2 changes: 1 addition & 1 deletion src/NetEscapades.EnumGenerators.Generators/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace NetEscapades.EnumGenerators;

public static class Constants
{
public const string Version = "1.0.0-beta19";
public const string Version = "1.0.0-beta20";
public const string MetadataSourcePropertyName = "EnumGenerator_EnumMetadataSource";
public const string ForceExtensionMembers = "EnumGenerator_ForceExtensionMembers";
}
16 changes: 8 additions & 8 deletions src/NetEscapades.EnumGenerators.Generators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ This adds a `<PackageReference>` to your project. You can additionally mark the
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19"
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20"
PrivateAssets="all" ExcludeAssets="runtime" />
<!-- -->

Expand Down Expand Up @@ -407,10 +407,10 @@ In some cases you may not want these dependencies to flow to other projects. Thi
</PropertyGroup>

<!-- Add the generator package with PrivateAssets -->
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All"/>
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All"/>

<!-- Optionally add the runtime dependencies package -->
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta20" />
</Project>
```

Expand Down Expand Up @@ -470,7 +470,7 @@ In general, for simplicity, we recommend referencing [NetEscapades.EnumGenerator
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
</Project>
```

Expand All @@ -483,7 +483,7 @@ In contrast, if you are producing a reusable library and don't want any runtime
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All" ExcludeAssets="runtime" />
</Project>
```

Expand All @@ -497,8 +497,8 @@ The final option is to reference [NetEscapades.EnumGenerators.Generators](https:
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All" ExcludeAssets="runtime"/>
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All" ExcludeAssets="runtime"/>
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta20" />
</Project>
```

Expand Down Expand Up @@ -590,6 +590,6 @@ The `[EnumExtensions]` attribute is decorated with the `[Conditional]` attribute
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
</Project>
```
2 changes: 1 addition & 1 deletion src/NetEscapades.EnumGenerators.Interceptors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This adds a `<PackageReference>` to your project. You can additionally mark the
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators.Interceptors" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators.Interceptors" Version="1.0.0-beta20" />
<!-- -->

</Project>
Expand Down
16 changes: 8 additions & 8 deletions src/NetEscapades.EnumGenerators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ This adds a `<PackageReference>` to your project:
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
<!-- -->

</Project>
Expand Down Expand Up @@ -479,10 +479,10 @@ In some cases you may not want these dependencies to flow to other projects. Thi
</PropertyGroup>

<!-- Add the generator package with PrivateAssets -->
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All"/>
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All"/>

<!-- Optionally add the runtime dependencies package -->
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta20" />
</Project>
```

Expand Down Expand Up @@ -542,7 +542,7 @@ In general, for simplicity, we recommend referencing [NetEscapades.EnumGenerator
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
</Project>
```

Expand All @@ -555,7 +555,7 @@ In contrast, if you are producing a reusable library and don't want any runtime
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All" ExcludeAssets="runtime" />
</Project>
```

Expand All @@ -569,8 +569,8 @@ The final option is to reference [NetEscapades.EnumGenerators.Generators](https:
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta19" PrivateAssets="All" ExcludeAssets="runtime"/>
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators.Generators" Version="1.0.0-beta20" PrivateAssets="All" ExcludeAssets="runtime"/>
<PackageReference Include="NetEscapades.EnumGenerators.RuntimeDependencies" Version="1.0.0-beta20" />
</Project>
```

Expand All @@ -592,6 +592,6 @@ The `[EnumExtensions]` attribute is decorated with the `[Conditional]` attribute
</PropertyGroup>

<!-- Add the package -->
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta19" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta20" />
</Project>
```
2 changes: 1 addition & 1 deletion version.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>beta19</VersionSuffix>
<VersionSuffix>beta20</VersionSuffix>
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</PackageVersion>
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
</PropertyGroup>
Expand Down
Loading