From c9bce2511a7f3b477d7a56bcff7556e9ab0cb8bf Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Wed, 24 Jan 2024 08:47:45 -0500 Subject: [PATCH 1/4] Added polyfills for 1. Required Member 2. Init properties 3. Nullable attributes --- README.md | 39 ++++++++++++ .../InitProperties/IsExternalInit.poly.cs | 12 ++++ .../Nullable/AllowNullAttribute.poly.cs | 23 +++++++ .../Nullable/DisallowNullAttribute.poly.cs | 24 +++++++ .../Nullable/DoesNotReturnAttribute.poly.cs | 22 +++++++ .../Nullable/DoesNotReturnIfAttribute.poly.cs | 37 +++++++++++ .../Nullable/MaybeNullAttribute.poly.cs | 28 +++++++++ .../Nullable/MaybeNullWhenAttribute.poly.cs | 36 +++++++++++ .../Nullable/MemberNotNullAttribute.poly.cs | 46 ++++++++++++++ .../MemberNotNullWhenAttribute.poly.cs | 62 +++++++++++++++++++ .../Nullable/NotNullAttribute.poly.cs | 28 +++++++++ .../NotNullIfNotNullAttribute.poly.cs | 43 +++++++++++++ .../Nullable/NotNullWhenAttribute.poly.cs | 37 +++++++++++ .../RequiredMemberAttribute.cs | 20 ++++++ ...urceGenerator.Foundations.Shared.projitems | 1 + .../SourceGenerator.Foundations.props | 29 ++++++++- 16 files changed, 486 insertions(+), 1 deletion(-) create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/InitProperties/IsExternalInit.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/AllowNullAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DisallowNullAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnIfAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullWhenAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullWhenAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullIfNotNullAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullWhenAttribute.poly.cs create mode 100644 src/SourceGenerator.Foundations.Shared/Polyfills/RequiredMembers/RequiredMemberAttribute.cs diff --git a/README.md b/README.md index 1c53c78..cbd2071 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,45 @@ This will popup the following window and you have to select your visual studio i ![AutoAttach](./img/DebuggerAttach.gif) +## Polyfills + +Source generators are written targeting `netstandard2.0` which means you don't have access to some features of the language. By using this library you will get the following. + +### `init` Properties: +```cs +// init gives a compiler error without the polyfill +public string MyProperty { get; init; } +``` +These can be disabled by setting the `false`. The default value is `true`. + +### Required Members +A way of specifying that a property or field is required to be set during object initialization, forcing the instance creator to provide an initial value for the member in an object initializer at the creation site. + +```cs +public class MyClass +{ + public required string Name { get; init; } +} +``` +These can be disabled by setting the `false`. The default value is `true`. + +### Nullable Attributes +These attributes enable the compiler to provide warnings when you may dereference a null value, throwing a [System.NullReferenceException](https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception). +| Attribute | Category | Meaning | +|-----------|----------|---------| +| `AllowNull` | Precondition | A non-nullable parameter, field, or property may be null. +| `DisallowNull` | Precondition | A nullable parameter, field, or property should never be null. +| `MaybeNull` | Postcondition | A non-nullable parameter, field, property, or return value may be null. +| `NotNull` | Postcondition | A nullable parameter, field, property, or return value will never be null. +| `MaybeNullWhen` | Conditional postcondition | A non-nullable argument may be null when the method returns the specified bool value. +| `NotNullWhen` | Conditional postcondition | A nullable argument won't be null when the method returns the specified bool value. +| `NotNullIfNotNull` | Conditional postcondition | A return value, property, or argument isn't null if the argument for the specified parameter isn't null. +| `MemberNotNull` | Method and property helper methods | The listed member won't be null when the method returns. +| `MemberNotNullWhen` | Method and property helper methods | The listed member won't be null when the method returns the specified bool value. +| `DoesNotReturn` | Unreachable code | A method or property never returns. In other words, it always throws an exception. +| `DoesNotReturnIf` | Unreachable code | This method or property never returns if the associated bool parameter has the specified value. + +These can be disabled by setting the `false`. The default value is `true`. ## Helpers diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/InitProperties/IsExternalInit.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/InitProperties/IsExternalInit.poly.cs new file mode 100644 index 0000000..ecca3de --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/InitProperties/IsExternalInit.poly.cs @@ -0,0 +1,12 @@ +namespace System.Runtime.CompilerServices +{ + using System.ComponentModel; + /// + /// Reserved to be used by the compiler for tracking metadata. + /// This class should not be used by developers in source code. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + internal static class IsExternalInit + { + } +} \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/AllowNullAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/AllowNullAttribute.poly.cs new file mode 100644 index 0000000..d8f4def --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/AllowNullAttribute.poly.cs @@ -0,0 +1,23 @@ +#nullable enable +#pragma warning disable +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that is allowed as an input even if the + /// corresponding type disallows it. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class AllowNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public AllowNullAttribute() { } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DisallowNullAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DisallowNullAttribute.poly.cs new file mode 100644 index 0000000..68e9bbe --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DisallowNullAttribute.poly.cs @@ -0,0 +1,24 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that is disallowed as an input even if the + /// corresponding type allows it. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class DisallowNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DisallowNullAttribute() { } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnAttribute.poly.cs new file mode 100644 index 0000000..8707979 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnAttribute.poly.cs @@ -0,0 +1,22 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that a method that will never return under any circumstance. + /// + [AttributeUsage(AttributeTargets.Method, Inherited = false)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class DoesNotReturnAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DoesNotReturnAttribute() { } + } +} +#pragma warning restore +#nullable restore diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnIfAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnIfAttribute.poly.cs new file mode 100644 index 0000000..6f6237a --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/DoesNotReturnIfAttribute.poly.cs @@ -0,0 +1,37 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that the method will not return if the associated + /// parameter is passed the specified value. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class DoesNotReturnIfAttribute : Attribute + { + /// + /// Gets the condition parameter value. Code after the method is considered unreachable + /// by diagnostics if the argument to the associated parameter matches this value. + /// + public bool ParameterValue { get; } + + /// + /// Initializes a new instance of the + /// class with the specified parameter value. + /// + /// + /// The condition parameter value. Code after the method is considered + /// unreachable by diagnostics if the argument to the associated parameter matches this value. + /// + public DoesNotReturnIfAttribute(bool parameterValue) + { + } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullAttribute.poly.cs new file mode 100644 index 0000000..998b214 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullAttribute.poly.cs @@ -0,0 +1,28 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that an output may be even if the + /// corresponding type disallows it. + /// + [AttributeUsage( + AttributeTargets.Field | AttributeTargets.Parameter | + AttributeTargets.Property | AttributeTargets.ReturnValue, + Inherited = false + )] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class MaybeNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public MaybeNullAttribute() { } + } +} + +#pragma warning restore +#nullable restore diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullWhenAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullWhenAttribute.poly.cs new file mode 100644 index 0000000..47b355d --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MaybeNullWhenAttribute.poly.cs @@ -0,0 +1,36 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that when a method returns , + /// the parameter may be even if the corresponding type disallows it. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class MaybeNullWhenAttribute : Attribute + { + /// + /// Gets the return value condition. + /// If the method returns this value, the associated parameter may be . + /// + public bool ReturnValue { get; } + + /// + /// Initializes the attribute with the specified return value condition. + /// + /// + /// The return value condition. + /// If the method returns this value, the associated parameter may be . + /// + public MaybeNullWhenAttribute(bool returnValue) + { + ReturnValue = returnValue; + } + } +} +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullAttribute.poly.cs new file mode 100644 index 0000000..a1abf48 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullAttribute.poly.cs @@ -0,0 +1,46 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that the method or property will ensure that the listed field and property members have + /// not- values. + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class MemberNotNullAttribute : Attribute + { + /// + /// Gets field or property member names. + /// + public string[] Members { get; } + + /// + /// Initializes the attribute with a field or property member. + /// + /// + /// The field or property member that is promised to be not-null. + /// + public MemberNotNullAttribute(string member) + { + Members = new[] { member }; + } + + /// + /// Initializes the attribute with the list of field and property members. + /// + /// + /// The list of field and property members that are promised to be not-null. + /// + public MemberNotNullAttribute(params string[] members) + { + Members = members; + } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullWhenAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullWhenAttribute.poly.cs new file mode 100644 index 0000000..e1d1f76 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/MemberNotNullWhenAttribute.poly.cs @@ -0,0 +1,62 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that the method or property will ensure that the listed field and property members have + /// non- values when returning with the specified return value condition. + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class MemberNotNullWhenAttribute : Attribute + { + /// + /// Gets the return value condition. + /// + public bool ReturnValue { get; } + + /// + /// Gets field or property member names. + /// + public string[] Members { get; } + + /// + /// Initializes the attribute with the specified return value condition and a field or property member. + /// + /// + /// The return value condition. If the method returns this value, + /// the associated parameter will not be . + /// + /// + /// The field or property member that is promised to be not-. + /// + public MemberNotNullWhenAttribute(bool returnValue, string member) + { + ReturnValue = returnValue; + Members = new[] { member }; + } + + /// + /// Initializes the attribute with the specified return value condition and list + /// of field and property members. + /// + /// + /// The return value condition. If the method returns this value, + /// the associated parameter will not be . + /// + /// + /// The list of field and property members that are promised to be not-null. + /// + public MemberNotNullWhenAttribute(bool returnValue, params string[] members) + { + ReturnValue = returnValue; + Members = members; + } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullAttribute.poly.cs new file mode 100644 index 0000000..a7d7812 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullAttribute.poly.cs @@ -0,0 +1,28 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that an output is not even if the + /// corresponding type allows it. + /// + [AttributeUsage( + AttributeTargets.Field | AttributeTargets.Parameter | + AttributeTargets.Property | AttributeTargets.ReturnValue, + Inherited = false + )] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class NotNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public NotNullAttribute() { } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullIfNotNullAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullIfNotNullAttribute.poly.cs new file mode 100644 index 0000000..ce844e2 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullIfNotNullAttribute.poly.cs @@ -0,0 +1,43 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that the output will be non- if the + /// named parameter is non-. + /// + [AttributeUsage( + AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, + AllowMultiple = true, + Inherited = false + )] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class NotNullIfNotNullAttribute : Attribute + { + /// + /// Gets the associated parameter name. + /// The output will be non- if the argument to the + /// parameter specified is non-. + /// + public string ParameterName { get; } + + /// + /// Initializes the attribute with the associated parameter name. + /// + /// + /// The associated parameter name. + /// The output will be non- if the argument to the + /// parameter specified is non-. + /// + public NotNullIfNotNullAttribute(string parameterName) + { + ParameterName = parameterName; + } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullWhenAttribute.poly.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullWhenAttribute.poly.cs new file mode 100644 index 0000000..8c6cf82 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/Nullable/NotNullWhenAttribute.poly.cs @@ -0,0 +1,37 @@ +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + + /// + /// Specifies that when a method returns , + /// the parameter will not be even if the corresponding type allows it. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] + internal sealed class NotNullWhenAttribute : Attribute + { + /// + /// Gets the return value condition. + /// If the method returns this value, the associated parameter will not be . + /// + public bool ReturnValue { get; } + + /// + /// Initializes the attribute with the specified return value condition. + /// + /// + /// The return value condition. + /// If the method returns this value, the associated parameter will not be . + /// + public NotNullWhenAttribute(bool returnValue) + { + ReturnValue = returnValue; + } + } +} + +#pragma warning restore +#nullable restore \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/Polyfills/RequiredMembers/RequiredMemberAttribute.cs b/src/SourceGenerator.Foundations.Shared/Polyfills/RequiredMembers/RequiredMemberAttribute.cs new file mode 100644 index 0000000..1fd40a8 --- /dev/null +++ b/src/SourceGenerator.Foundations.Shared/Polyfills/RequiredMembers/RequiredMemberAttribute.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Runtime.CompilerServices +{ + /// + /// Specifies that a type has required members or that a member is required. + /// + [global::System.AttributeUsage( + global::System.AttributeTargets.Class | + global::System.AttributeTargets.Struct | + global::System.AttributeTargets.Field | + global::System.AttributeTargets.Property, + AllowMultiple = false, + Inherited = false)] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + internal sealed class RequiredMemberAttribute : global::System.Attribute + { + } +} \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems b/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems index e781bb5..2e86ec8 100644 --- a/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems +++ b/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems @@ -15,5 +15,6 @@ + \ No newline at end of file diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props index 32e801d..b4017be 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props @@ -13,6 +13,9 @@ true $(MSBuildThisFileDirectory)SourceGenerator.Foundations.MSBuild.dll $(MSBuildThisFileDirectory)SourceGenerator.Foundations.Injector.exe + true + true + true @@ -22,8 +25,32 @@ - + + + + SGF/%(RecursiveDir)%(Filename)%(Extension) + + + SGF/Polyfills/Nullable/%(RecursiveDir)%(Filename)%(Extension) + + + + SGF/Polyfills/InitProperties/%(RecursiveDir)%(Filename)%(Extension) + + + + SGF/Polyfills/RequiredMembers/%(RecursiveDir)%(Filename)%(Extension) + From 3ad6714735199485e843a5251fa56c8340fc0929 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Wed, 24 Jan 2024 22:56:28 -0500 Subject: [PATCH 2/4] Fixed the source generators not pulling in all scripts --- .../{ => Core}/Configuration/ResourceConfiguration.cs | 0 .../{ => Core}/IncrementalGenerator.cs | 0 .../{ => Core}/Reflection/AssemblyNameComparer.cs | 0 .../{ => Core}/Reflection/AssemblyResolver.cs | 0 .../{ => Core}/SgfInitializationContext.cs | 0 .../{ => Core}/SgfSourceProductionContext.cs | 0 .../SourceGenerator.Foundations.Shared.projitems | 8 +------- .../SourceGenerator.Foundations.props | 3 +-- 8 files changed, 2 insertions(+), 9 deletions(-) rename src/SourceGenerator.Foundations.Shared/{ => Core}/Configuration/ResourceConfiguration.cs (100%) rename src/SourceGenerator.Foundations.Shared/{ => Core}/IncrementalGenerator.cs (100%) rename src/SourceGenerator.Foundations.Shared/{ => Core}/Reflection/AssemblyNameComparer.cs (100%) rename src/SourceGenerator.Foundations.Shared/{ => Core}/Reflection/AssemblyResolver.cs (100%) rename src/SourceGenerator.Foundations.Shared/{ => Core}/SgfInitializationContext.cs (100%) rename src/SourceGenerator.Foundations.Shared/{ => Core}/SgfSourceProductionContext.cs (100%) diff --git a/src/SourceGenerator.Foundations.Shared/Configuration/ResourceConfiguration.cs b/src/SourceGenerator.Foundations.Shared/Core/Configuration/ResourceConfiguration.cs similarity index 100% rename from src/SourceGenerator.Foundations.Shared/Configuration/ResourceConfiguration.cs rename to src/SourceGenerator.Foundations.Shared/Core/Configuration/ResourceConfiguration.cs diff --git a/src/SourceGenerator.Foundations.Shared/IncrementalGenerator.cs b/src/SourceGenerator.Foundations.Shared/Core/IncrementalGenerator.cs similarity index 100% rename from src/SourceGenerator.Foundations.Shared/IncrementalGenerator.cs rename to src/SourceGenerator.Foundations.Shared/Core/IncrementalGenerator.cs diff --git a/src/SourceGenerator.Foundations.Shared/Reflection/AssemblyNameComparer.cs b/src/SourceGenerator.Foundations.Shared/Core/Reflection/AssemblyNameComparer.cs similarity index 100% rename from src/SourceGenerator.Foundations.Shared/Reflection/AssemblyNameComparer.cs rename to src/SourceGenerator.Foundations.Shared/Core/Reflection/AssemblyNameComparer.cs diff --git a/src/SourceGenerator.Foundations.Shared/Reflection/AssemblyResolver.cs b/src/SourceGenerator.Foundations.Shared/Core/Reflection/AssemblyResolver.cs similarity index 100% rename from src/SourceGenerator.Foundations.Shared/Reflection/AssemblyResolver.cs rename to src/SourceGenerator.Foundations.Shared/Core/Reflection/AssemblyResolver.cs diff --git a/src/SourceGenerator.Foundations.Shared/SgfInitializationContext.cs b/src/SourceGenerator.Foundations.Shared/Core/SgfInitializationContext.cs similarity index 100% rename from src/SourceGenerator.Foundations.Shared/SgfInitializationContext.cs rename to src/SourceGenerator.Foundations.Shared/Core/SgfInitializationContext.cs diff --git a/src/SourceGenerator.Foundations.Shared/SgfSourceProductionContext.cs b/src/SourceGenerator.Foundations.Shared/Core/SgfSourceProductionContext.cs similarity index 100% rename from src/SourceGenerator.Foundations.Shared/SgfSourceProductionContext.cs rename to src/SourceGenerator.Foundations.Shared/Core/SgfSourceProductionContext.cs diff --git a/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems b/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems index 2e86ec8..f1d8d78 100644 --- a/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems +++ b/src/SourceGenerator.Foundations.Shared/SourceGenerator.Foundations.Shared.projitems @@ -9,12 +9,6 @@ SGF - - - - - - - + \ No newline at end of file diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props index b4017be..d02d767 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props @@ -25,10 +25,9 @@ - - + SGF/%(RecursiveDir)%(Filename)%(Extension) From e79aed6e006eb9208847051d11af80fca0416b11 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Wed, 24 Jan 2024 23:00:57 -0500 Subject: [PATCH 3/4] Fixed nullable properties not being included --- .../SourceGenerator.Foundations.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props index d02d767..1a4c9c5 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props @@ -33,7 +33,7 @@ SGF/Polyfills/Nullable/%(RecursiveDir)%(Filename)%(Extension) From b80fee985d7ea243946ee7c8800b9347d83b232c Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Fri, 26 Jan 2024 20:10:41 -0500 Subject: [PATCH 4/4] Updated gitversion to push incremental changes --- GitVersion.yml | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index 2771062..83edb81 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,25 +1,2 @@ -branches: - main: - regex: ^master$|^main$ - mode: ContinuousDelivery - tag: 'rc' - increment: Patch - prevent-increment-of-merged-branch-version: true - track-merge-target: false - source-branches: [ 'develop', 'release' ] - tracks-release-branches: false - is-release-branch: false - is-mainline: true - pre-release-weight: 55000 - develop: - regex: ^dev(elop)?(ment)?$ - mode: ContinuousDeployment - tag: alpha - increment: Minor - prevent-increment-of-merged-branch-version: false - track-merge-target: true - source-branches: [] - tracks-release-branches: true - is-release-branch: false - is-mainline: false - pre-release-weight: 0 \ No newline at end of file +mode: ContinuousDeployment +branches: {} \ No newline at end of file