From 3bb80e7223a370b7951e630baf845b16a3ef2b7e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 10 Sep 2022 18:19:32 +0200 Subject: [PATCH 01/16] Add polyfills for ForAttributeWithMetadataName --- .../GeneratorAttributeSyntaxContext.cs | 61 +++++++++++++ .../SyntaxValueProviderExtensions.cs | 86 +++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs create mode 100644 CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs new file mode 100644 index 000000000..33c62318c --- /dev/null +++ b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs @@ -0,0 +1,61 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#if !ROSLYN_4_3 + +using System.Collections.Immutable; + +namespace Microsoft.CodeAnalysis; + +/// +/// A type containing information for a match from . +/// +internal readonly struct GeneratorAttributeSyntaxContext +{ + /// + /// Creates a new instance with the specified parameters. + /// + /// The syntax node the attribute is attached to. + /// The symbol that the attribute is attached to. + /// Semantic model for the file that is contained within. + /// The collection of matching attributes. + internal GeneratorAttributeSyntaxContext( + SyntaxNode targetNode, + ISymbol targetSymbol, + SemanticModel semanticModel, + ImmutableArray attributes) + { + TargetNode = targetNode; + TargetSymbol = targetSymbol; + SemanticModel = semanticModel; + Attributes = attributes; + } + + /// + /// The syntax node the attribute is attached to. For example, with [CLSCompliant] class C { } this would the class declaration node. + /// + public SyntaxNode TargetNode { get; } + + /// + /// The symbol that the attribute is attached to. For example, with [CLSCompliant] class C { } this would be the for "C". + /// + public ISymbol TargetSymbol { get; } + + /// + /// Semantic model for the file that is contained within. + /// + public SemanticModel SemanticModel { get; } + + /// + /// s for any matching attributes on . Always non-empty. All + /// these attributes will have an whose fully qualified name metadata + /// name matches the name requested in . + /// + /// To get the entire list of attributes, use on . + /// + /// + public ImmutableArray Attributes { get; } +} + +#endif diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs new file mode 100644 index 000000000..aaea1fd4c --- /dev/null +++ b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs @@ -0,0 +1,86 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#if !ROSLYN_4_3 + +using System.Threading; +using System; +using System.Collections.Immutable; +using CommunityToolkit.Mvvm.SourceGenerators.Extensions; + +namespace Microsoft.CodeAnalysis; + +/// +/// Extension methods for the type. +/// +internal static class SyntaxValueProviderExtensions +{ + /// + /// Creates an that can provide a transform over all s if that node has an attribute on it that binds to a with the + /// same fully-qualified metadata as the provided . should be the fully-qualified, metadata name of the attribute, including the + /// Attribute suffix. For example "System.CLSCompliantAttribute for . + /// + /// The source instance to use. + /// The fully qualified metadata name of the attribute to look for. + /// A function that determines if the given attribute target () should be transformed. Nodes that do not pass this + /// predicate will not have their attributes looked at at all. + /// A function that performs the transform. This will only be passed nodes that return for and which have a matching whose + /// has the same fully qualified, metadata name as . + public static IncrementalValuesProvider ForAttributeWithMetadataName( + this SyntaxValueProvider syntaxValueProvider, + string fullyQualifiedMetadataName, + Func predicate, + Func transform) + { + string fullyQualifiedMetadataNameWithGlobalPrefix = $"global::{fullyQualifiedMetadataName}"; + + return + syntaxValueProvider + .CreateSyntaxProvider( + predicate, + (context, token) => + { + ISymbol? symbol = context.SemanticModel.GetDeclaredSymbol(context.Node, token); + + // If the syntax node doesn't have a declared symbol, just skip this node. This would be + // the case for eg. lambda attributes, but those are not supported by the MVVM Toolkit. + if (symbol is null) + { + return null; + } + + // Skip symbols without the target attribute + if (!symbol.TryGetAttributeWithFullyQualifiedName(fullyQualifiedMetadataNameWithGlobalPrefix, out AttributeData? attributeData)) + { + return null; + } + + // Create the GeneratorAttributeSyntaxContext value to pass to the input transform. The attributes array + // will only ever have a single value, but that's fine with the attributes the various generators look for. + GeneratorAttributeSyntaxContext syntaxContext = new( + targetNode: context.Node, + targetSymbol: symbol, + semanticModel: context.SemanticModel, + attributes: ImmutableArray.Create(attributeData)); + + return new Option(transform(syntaxContext, token)); + }) + .Where(static item => item is not null) + .Select(static (item, _) => item!.Value)!; + } + + /// + /// A simple record to wrap a value that might be missing. + /// + /// The type of values to wrap + /// The wrapped value, if it exists. + private sealed record Option(T? Value); +} + +#endif From 1e1ba013e83ac418994512afe1498bfabd807e7b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 10 Sep 2022 18:27:44 +0200 Subject: [PATCH 02/16] Use ForAttributeWithMetadataName whenever possible --- .../INotifyPropertyChangedGenerator.cs | 2 +- .../ObservableObjectGenerator.cs | 2 +- .../ObservablePropertyGenerator.cs | 11 +++----- .../ObservableRecipientGenerator.cs | 2 +- .../TransitiveMembersGenerator.cs | 27 ++++++++----------- .../Extensions/ISymbolExtensions.cs | 4 +++ .../TypeDeclarationSyntaxExtensions.cs | 26 ++++++++++++++++++ .../Input/RelayCommandGenerator.cs | 13 +++------ 8 files changed, 51 insertions(+), 36 deletions(-) diff --git a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/INotifyPropertyChangedGenerator.cs b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/INotifyPropertyChangedGenerator.cs index 37882bc09..90d6a244d 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/INotifyPropertyChangedGenerator.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/INotifyPropertyChangedGenerator.cs @@ -23,7 +23,7 @@ public sealed class INotifyPropertyChangedGenerator : TransitiveMembersGenerator /// Initializes a new instance of the class. /// public INotifyPropertyChangedGenerator() - : base("global::CommunityToolkit.Mvvm.ComponentModel.INotifyPropertyChangedAttribute") + : base("CommunityToolkit.Mvvm.ComponentModel.INotifyPropertyChangedAttribute") { } diff --git a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableObjectGenerator.cs b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableObjectGenerator.cs index c101ad098..2c45778dd 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableObjectGenerator.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableObjectGenerator.cs @@ -22,7 +22,7 @@ public sealed class ObservableObjectGenerator : TransitiveMembersGenerator class. /// public ObservableObjectGenerator() - : base("global::CommunityToolkit.Mvvm.ComponentModel.ObservableObjectAttribute") + : base("CommunityToolkit.Mvvm.ComponentModel.ObservableObjectAttribute") { } diff --git a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservablePropertyGenerator.cs b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservablePropertyGenerator.cs index c99264446..e6c567b53 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservablePropertyGenerator.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservablePropertyGenerator.cs @@ -27,7 +27,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context) // Gather info for all annotated fields IncrementalValuesProvider<(HierarchyInfo Hierarchy, Result Info)> propertyInfoWithErrors = context.SyntaxProvider - .CreateSyntaxProvider( + .ForAttributeWithMetadataName( + "CommunityToolkit.Mvvm.ComponentModel.ObservablePropertyAttribute", static (node, _) => node is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax { Parent: ClassDeclarationSyntax or RecordDeclarationSyntax, AttributeLists.Count: > 0 } } }, static (context, token) => { @@ -36,13 +37,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) return default; } - IFieldSymbol fieldSymbol = (IFieldSymbol)context.SemanticModel.GetDeclaredSymbol(context.Node, token)!; - - // Filter the fields using [ObservableProperty] - if (!fieldSymbol.HasAttributeWithFullyQualifiedName("global::CommunityToolkit.Mvvm.ComponentModel.ObservablePropertyAttribute")) - { - return default; - } + IFieldSymbol fieldSymbol = (IFieldSymbol)context.TargetSymbol; // Produce the incremental models HierarchyInfo hierarchy = HierarchyInfo.From(fieldSymbol.ContainingType); diff --git a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableRecipientGenerator.cs b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableRecipientGenerator.cs index af2176836..d20989381 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableRecipientGenerator.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservableRecipientGenerator.cs @@ -25,7 +25,7 @@ public sealed class ObservableRecipientGenerator : TransitiveMembersGenerator class. /// public ObservableRecipientGenerator() - : base("global::CommunityToolkit.Mvvm.ComponentModel.ObservableRecipientAttribute") + : base("CommunityToolkit.Mvvm.ComponentModel.ObservableRecipientAttribute") { } diff --git a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.cs b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.cs index 95fc8967a..dd385094b 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.cs @@ -21,9 +21,9 @@ namespace CommunityToolkit.Mvvm.SourceGenerators; public abstract partial class TransitiveMembersGenerator : IIncrementalGenerator { /// - /// The fully qualified name of the attribute type to look for. + /// The fully qualified metadata name of the attribute type to look for. /// - private readonly string attributeType; + private readonly string fullyQualifiedAttributeMetadataName; /// /// An instance to compare intermediate models. @@ -51,13 +51,13 @@ public abstract partial class TransitiveMembersGenerator : IIncrementalGe /// /// Initializes a new instance of the class. /// - /// The fully qualified name of the attribute type to look for. + /// The fully qualified metadata name of the attribute type to look for. /// An instance to compare intermediate models. - private protected TransitiveMembersGenerator(string attributeType, IEqualityComparer? comparer = null) + private protected TransitiveMembersGenerator(string fullyQualifiedAttributeMetadataName, IEqualityComparer? comparer = null) { - this.attributeType = attributeType; + this.fullyQualifiedAttributeMetadataName = fullyQualifiedAttributeMetadataName; this.comparer = comparer ?? EqualityComparer.Default; - this.classDeclaration = Execute.LoadClassDeclaration(attributeType); + this.classDeclaration = Execute.LoadClassDeclaration(fullyQualifiedAttributeMetadataName); Execute.ProcessMemberDeclarations( GetType(), @@ -72,8 +72,9 @@ public void Initialize(IncrementalGeneratorInitializationContext context) // Gather all generation info, and any diagnostics IncrementalValuesProvider> generationInfoWithErrors = context.SyntaxProvider - .CreateSyntaxProvider( - static (node, _) => node is ClassDeclarationSyntax { AttributeLists.Count: > 0 }, + .ForAttributeWithMetadataName( + this.fullyQualifiedAttributeMetadataName, + static (node, _) => node is ClassDeclarationSyntax classDeclaration && classDeclaration.HasOrPotentiallyHasAttributes(), (context, token) => { if (!context.SemanticModel.Compilation.HasLanguageVersionAtLeastEqualTo(LanguageVersion.CSharp8)) @@ -81,16 +82,10 @@ public void Initialize(IncrementalGeneratorInitializationContext context) return default; } - INamedTypeSymbol typeSymbol = (INamedTypeSymbol)context.SemanticModel.GetDeclaredSymbol(context.Node, token)!; - - // Filter the types with the target attribute - if (!typeSymbol.TryGetAttributeWithFullyQualifiedName(this.attributeType, out AttributeData? attributeData)) - { - return default; - } + INamedTypeSymbol typeSymbol = (INamedTypeSymbol)context.TargetSymbol; // Gather all generation info, and any diagnostics - TInfo? info = ValidateTargetTypeAndGetInfo(typeSymbol, attributeData, context.SemanticModel.Compilation, out ImmutableArray diagnostics); + TInfo? info = ValidateTargetTypeAndGetInfo(typeSymbol, context.Attributes[0], context.SemanticModel.Compilation, out ImmutableArray diagnostics); // If there are any diagnostics, there's no need to compute the hierarchy info at all, just return them if (diagnostics.Length > 0) diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs b/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs index 8aa4a57fe..8460e4afb 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs @@ -3,7 +3,9 @@ // See the LICENSE file in the project root for more information. using System.Collections.Immutable; +#if !ROSLYN_4_3 using System.Diagnostics.CodeAnalysis; +#endif using Microsoft.CodeAnalysis; namespace CommunityToolkit.Mvvm.SourceGenerators.Extensions; @@ -65,6 +67,7 @@ public static bool HasAttributeWithFullyQualifiedName(this ISymbol symbol, strin return false; } +#if !ROSLYN_4_3 /// /// Tries to get an attribute with the specified full name. /// @@ -90,6 +93,7 @@ public static bool TryGetAttributeWithFullyQualifiedName(this ISymbol symbol, st return false; } +#endif /// /// Calculates the effective accessibility for a given symbol. diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Extensions/TypeDeclarationSyntaxExtensions.cs b/CommunityToolkit.Mvvm.SourceGenerators/Extensions/TypeDeclarationSyntaxExtensions.cs index 32148a5d3..a00130d1b 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/Extensions/TypeDeclarationSyntaxExtensions.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/Extensions/TypeDeclarationSyntaxExtensions.cs @@ -38,4 +38,30 @@ public static bool HasOrPotentiallyHasBaseTypes(this TypeDeclarationSyntax typeD return false; } + + /// + /// Checks whether a given has or could possibly have any attributes, using only syntax. + /// + /// The input instance to check. + /// Whether has or could possibly have any attributes. + public static bool HasOrPotentiallyHasAttributes(this TypeDeclarationSyntax typeDeclaration) + { + // If the type has any attributes lists, then clearly it can have attributes + if (typeDeclaration.AttributeLists.Count > 0) + { + return true; + } + + // If the declaration has no attribute lists, check if the type is partial. If it is, it means + // that there could be another partial declaration with some attribute lists over them. + foreach (SyntaxToken modifier in typeDeclaration.Modifiers) + { + if (modifier.IsKind(SyntaxKind.PartialKeyword)) + { + return true; + } + } + + return false; + } } diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Input/RelayCommandGenerator.cs b/CommunityToolkit.Mvvm.SourceGenerators/Input/RelayCommandGenerator.cs index 8e0660f7b..25331793a 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/Input/RelayCommandGenerator.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/Input/RelayCommandGenerator.cs @@ -26,7 +26,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context) // Gather info for all annotated command methods (starting from method declarations with at least one attribute) IncrementalValuesProvider<(HierarchyInfo Hierarchy, Result Info)> commandInfoWithErrors = context.SyntaxProvider - .CreateSyntaxProvider( + .ForAttributeWithMetadataName( + "CommunityToolkit.Mvvm.Input.RelayCommandAttribute", static (node, _) => node is MethodDeclarationSyntax { Parent: ClassDeclarationSyntax, AttributeLists.Count: > 0 }, static (context, token) => { @@ -35,17 +36,11 @@ public void Initialize(IncrementalGeneratorInitializationContext context) return default; } - IMethodSymbol methodSymbol = (IMethodSymbol)context.SemanticModel.GetDeclaredSymbol(context.Node, token)!; - - // Filter the methods using [RelayCommand] - if (!methodSymbol.TryGetAttributeWithFullyQualifiedName("global::CommunityToolkit.Mvvm.Input.RelayCommandAttribute", out AttributeData? attribute)) - { - return default; - } + IMethodSymbol methodSymbol = (IMethodSymbol)context.TargetSymbol; // Produce the incremental models HierarchyInfo hierarchy = HierarchyInfo.From(methodSymbol.ContainingType); - CommandInfo? commandInfo = Execute.GetInfo(methodSymbol, attribute, out ImmutableArray diagnostics); + CommandInfo? commandInfo = Execute.GetInfo(methodSymbol, context.Attributes[0], out ImmutableArray diagnostics); return (Hierarchy: hierarchy, new Result(commandInfo, diagnostics)); }) From 4e43f2901edbf18a89e9fa01e5dc6ed4c8602e82 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 10 Sep 2022 20:03:28 +0200 Subject: [PATCH 03/16] Fix Roslyn multi-targeting and testing --- CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj | 4 ++-- azure-pipelines.yml | 12 ++++++------ .../CommunityToolkit.Mvvm.ExternalAssembly.csproj | 8 +------- ...ityToolkit.Mvvm.SourceGenerators.UnitTests.csproj | 8 +------- .../CommunityToolkit.Mvvm.UnitTests.csproj | 11 +---------- 5 files changed, 11 insertions(+), 32 deletions(-) diff --git a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj index 2160f590d..00746d596 100644 --- a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj +++ b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj @@ -43,10 +43,10 @@ - MvvmToolkitSourceGeneratorRoslynVersion=4.0.1;MvvmToolkitIsGeneratingNuGetPackage=true + MvvmToolkitSourceGeneratorRoslynVersion=4.0.1;MvvmToolkitIsGeneratingNuGetPackage=true - MvvmToolkitSourceGeneratorRoslynVersion=4.3.0;MvvmToolkitIsGeneratingNuGetPackage=true + MvvmToolkitSourceGeneratorRoslynVersion=4.3.0;MvvmToolkitIsGeneratingNuGetPackage=true diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5210cebba..fd950a919 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,13 +46,13 @@ jobs: - script: dotnet test -c Release -f net6.0 -l "trx;LogFileName=VSTestResults_net6.0.trx" displayName: Run .NET 6 unit tests - # Run the .NET 6 MVVM Toolkit tests targeting Roslyn 4.0.1 - - script: dotnet test tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.csproj -c Release -f net6.0 -p:MvvmToolkitSourceGeneratorRoslynVersion=4.0.1 -l "trx;LogFileName=VSTestResults_net6.0_mvvmtoolkit_roslyn401.trx" - displayName: Run CommunityToolkit.Mvvm.UnitTests unit tests with Roslyn 4.0.1 + # Run the .NET 6 MVVM Toolkit tests targeting Roslyn 4.3.0 + - script: dotnet test tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.csproj -c Release -f net6.0 -p:MvvmToolkitSourceGeneratorRoslynVersion=4.3.0 -l "trx;LogFileName=VSTestResults_net6.0_mvvmtoolkit_roslyn430.trx" + displayName: Run CommunityToolkit.Mvvm.UnitTests unit tests with Roslyn 4.3.0 - # Run the .NET 6 MVVM Toolkit source generator tests targeting Roslyn 4.0.1 - - script: dotnet test tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj -c Release -f net6.0 -p:MvvmToolkitSourceGeneratorRoslynVersion=4.0.1 -l "trx;LogFileName=VSTestResults_net6.0_mvvmtoolkit_generators_roslyn401.trx" - displayName: Run CommunityToolkit.Mvvm.SourceGenerators.UnitTests unit tests with Roslyn 4.0.1 + # Run the .NET 6 MVVM Toolkit source generator tests targeting Roslyn 4.3.0 + - script: dotnet test tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj -c Release -f net6.0 -p:MvvmToolkitSourceGeneratorRoslynVersion=4.3.0 -l "trx;LogFileName=VSTestResults_net6.0_mvvmtoolkit_generators_roslyn430.trx" + displayName: Run CommunityToolkit.Mvvm.SourceGenerators.UnitTests unit tests with Roslyn 4.3.0 # Run .NET Core 3.1 tests - script: dotnet test -c Release -f netcoreapp3.1 -l "trx;LogFileName=VSTestResults_netcoreapp3.1.trx" diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj index d2a95ec41..d0d39011b 100644 --- a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj @@ -12,15 +12,9 @@ $(NoWarn);CS8002;SA0001 - - - 4.3.0 - - - MvvmToolkitSourceGeneratorRoslynVersion=$(MvvmToolkitSourceGeneratorRoslynVersion) - + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj index d30d2e3c9..9940b12f8 100644 --- a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj @@ -12,15 +12,9 @@ - - - 4.3.0 - - - MvvmToolkitSourceGeneratorRoslynVersion=$(MvvmToolkitSourceGeneratorRoslynVersion) - + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj index d033b5323..ed165693b 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj @@ -13,17 +13,8 @@ - - - - - 4.3.0 - - - - MvvmToolkitSourceGeneratorRoslynVersion=$(MvvmToolkitSourceGeneratorRoslynVersion) - + \ No newline at end of file From 8569223a766d1addfa9e6956f0601da085c55306 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 12 Sep 2022 22:25:58 +0200 Subject: [PATCH 04/16] Restructure source generator into shared project --- ...kit.Mvvm.SourceGenerators.Roslyn401.csproj | 6 ++ ...kit.Mvvm.SourceGenerators.Roslyn430.csproj | 6 ++ ...munityToolkit.Mvvm.SourceGenerators.csproj | 66 -------------- ...ityToolkit.Mvvm.SourceGenerators.projitems | 88 +++++++++++++++++++ ...mmunityToolkit.Mvvm.SourceGenerators.props | 38 ++++++++ ...munityToolkit.Mvvm.SourceGenerators.shproj | 13 +++ .../CommunityToolkit.Mvvm.csproj | 8 +- dotnet Community Toolkit.sln | 31 ++++++- ...leINotifyPropertyChanging.UnitTests.csproj | 2 +- ...munityToolkit.Mvvm.ExternalAssembly.csproj | 2 +- ...kit.Mvvm.SourceGenerators.UnitTests.csproj | 2 +- .../CommunityToolkit.Mvvm.UnitTests.csproj | 2 +- 12 files changed, 187 insertions(+), 77 deletions(-) create mode 100644 CommunityToolkit.Mvvm.SourceGenerators.Roslyn401/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj create mode 100644 CommunityToolkit.Mvvm.SourceGenerators.Roslyn430/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.csproj delete mode 100644 CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.csproj create mode 100644 CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems create mode 100644 CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props create mode 100644 CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.shproj diff --git a/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj b/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj new file mode 100644 index 000000000..d19620f52 --- /dev/null +++ b/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.csproj b/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.csproj new file mode 100644 index 000000000..3cea30b35 --- /dev/null +++ b/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.csproj @@ -0,0 +1,6 @@ + + + + + + diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.csproj b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.csproj deleted file mode 100644 index 18e81311f..000000000 --- a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.csproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - netstandard2.0 - false - - - - - - - 4.0.1 - - - bin\$(Configuration)\roslyn$(MvvmToolkitSourceGeneratorRoslynVersion.Substring(0, 3))\ - - - $(DefineConstants);ROSLYN_$(MvvmToolkitSourceGeneratorRoslynVersion.Substring(0, 3).Replace('.', '_')) - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - \ No newline at end of file diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems new file mode 100644 index 000000000..e77dddec7 --- /dev/null +++ b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems @@ -0,0 +1,88 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 5e7f1212-a54b-40ca-98c5-1ff5cd1a1638 + + + CommunityToolkit.Mvvm.SourceGenerators + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props new file mode 100644 index 000000000..636d29dee --- /dev/null +++ b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props @@ -0,0 +1,38 @@ + + + + netstandard2.0 + false + + + + + + + $(MSBuildProjectName.Substring(45, 1)) + $(MSBuildProjectName.Substring(46, 1)) + $(MSBuildProjectName.Substring(47, 1)) + $(MvvmToolkitSourceGeneratorRoslynMajorVersion).$(MvvmToolkitSourceGeneratorRoslynMinorVersion).$(MvvmToolkitSourceGeneratorRoslynPatchVersion) + + + bin\$(Configuration)\roslyn$(MvvmToolkitSourceGeneratorRoslynVersion.Substring(0, 3))\ + + + $(DefineConstants);ROSLYN_$(MvvmToolkitSourceGeneratorRoslynVersion.Substring(0, 3).Replace('.', '_')) + + + + + + + \ No newline at end of file diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.shproj b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.shproj new file mode 100644 index 000000000..a9dfb1cf5 --- /dev/null +++ b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.shproj @@ -0,0 +1,13 @@ + + + + 5e7f1212-a54b-40ca-98c5-1ff5cd1a1638 + 14.0 + + + + + + + + diff --git a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj index 00746d596..287a388c9 100644 --- a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj +++ b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj @@ -42,12 +42,8 @@ - - MvvmToolkitSourceGeneratorRoslynVersion=4.0.1;MvvmToolkitIsGeneratingNuGetPackage=true - - - MvvmToolkitSourceGeneratorRoslynVersion=4.3.0;MvvmToolkitIsGeneratingNuGetPackage=true - + + diff --git a/dotnet Community Toolkit.sln b/dotnet Community Toolkit.sln index 32281fbde..66460e318 100644 --- a/dotnet Community Toolkit.sln +++ b/dotnet Community Toolkit.sln @@ -36,7 +36,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{88C6FFBE-3 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Diagnostics", "CommunityToolkit.Diagnostics\CommunityToolkit.Diagnostics.csproj", "{76F89522-CA28-458D-801D-947AB033A758}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators", "CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.csproj", "{E24D1146-5AD8-498F-A518-4890D8BF4937}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators.Roslyn401", "CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj", "{E24D1146-5AD8-498F-A518-4890D8BF4937}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators.UnitTests", "tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj", "{338C3BE4-2E71-4F21-AD30-03FDBB47A272}" EndProject @@ -65,6 +65,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.Disab EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.Internals.UnitTests", "tests\CommunityToolkit.Mvvm.Internals.UnitTests\CommunityToolkit.Mvvm.Internals.UnitTests.csproj", "{743D74BA-12AE-4639-AD77-B9DDA9C03255}" EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CommunityToolkit.Mvvm.SourceGenerators", "CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.shproj", "{5E7F1212-A54B-40CA-98C5-1FF5CD1A1638}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Mvvm.SourceGenerators.Roslyn430", "CommunityToolkit.Mvvm.SourceGenerators.Roslyn430\CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.csproj", "{DF455C40-B18E-4890-8758-7CCCB5CA7052}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -339,6 +343,26 @@ Global {743D74BA-12AE-4639-AD77-B9DDA9C03255}.Release|x64.Build.0 = Release|Any CPU {743D74BA-12AE-4639-AD77-B9DDA9C03255}.Release|x86.ActiveCfg = Release|Any CPU {743D74BA-12AE-4639-AD77-B9DDA9C03255}.Release|x86.Build.0 = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|ARM.ActiveCfg = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|ARM.Build.0 = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|ARM64.Build.0 = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|x64.ActiveCfg = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|x64.Build.0 = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|x86.ActiveCfg = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Debug|x86.Build.0 = Debug|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|Any CPU.Build.0 = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|ARM.ActiveCfg = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|ARM.Build.0 = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|ARM64.ActiveCfg = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|ARM64.Build.0 = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|x64.ActiveCfg = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|x64.Build.0 = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|x86.ActiveCfg = Release|Any CPU + {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -359,4 +383,9 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5403B0C4-F244-4F73-A35C-FE664D0F4345} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.projitems*{5e7f1212-a54b-40ca-98c5-1ff5cd1a1638}*SharedItemsImports = 13 + CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.projitems*{df455c40-b18e-4890-8758-7cccb5ca7052}*SharedItemsImports = 5 + CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.projitems*{e24d1146-5ad8-498f-a518-4890d8bf4937}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj index b75b2df09..e23106604 100644 --- a/tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj index d0d39011b..d486f9f95 100644 --- a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj index 9940b12f8..fefce4441 100644 --- a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj index ed165693b..00fc48e97 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj @@ -14,7 +14,7 @@ - + \ No newline at end of file From c98b03841d9ba201f12ec2eb595d1f802a02cf6f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 12 Sep 2022 23:05:58 +0200 Subject: [PATCH 05/16] Switch to expression for project name Roslyn version --- .../CommunityToolkit.Mvvm.SourceGenerators.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props index 636d29dee..c8a969ca8 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props +++ b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props @@ -19,9 +19,9 @@ Get the Roslyn version to use from the name of the project importing this .props file. All projects will use the ".Roslyn.csproj" naming scheme. --> - $(MSBuildProjectName.Substring(45, 1)) - $(MSBuildProjectName.Substring(46, 1)) - $(MSBuildProjectName.Substring(47, 1)) + $(MSBuildProjectName.Substring($([MSBuild]::Subtract($(MSBuildProjectName.Length), 3)), 1)) + $(MSBuildProjectName.Substring($([MSBuild]::Subtract($(MSBuildProjectName.Length), 2)), 1)) + $(MSBuildProjectName.Substring($([MSBuild]::Subtract($(MSBuildProjectName.Length), 1)), 1)) $(MvvmToolkitSourceGeneratorRoslynMajorVersion).$(MvvmToolkitSourceGeneratorRoslynMinorVersion).$(MvvmToolkitSourceGeneratorRoslynPatchVersion) From 434f5cc5e945b720594bb37c395867c3f5620c8e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 12 Sep 2022 23:18:20 +0200 Subject: [PATCH 06/16] Remove custom output paths, fix assembly paths --- .../CommunityToolkit.Mvvm.SourceGenerators.props | 6 +++--- CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props index c8a969ca8..4b61b402b 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props +++ b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props @@ -15,6 +15,9 @@ --> + + $(MSBuildProjectName.Substring(0, $([MSBuild]::Subtract($(MSBuildProjectName.Length), 10)))) + - bin\$(Configuration)\roslyn$(MvvmToolkitSourceGeneratorRoslynVersion.Substring(0, 3))\ - $(DefineConstants);ROSLYN_$(MvvmToolkitSourceGeneratorRoslynVersion.Substring(0, 3).Replace('.', '_')) diff --git a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj index 287a388c9..98432bec2 100644 --- a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj +++ b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj @@ -58,8 +58,8 @@ Pack the source generator to the right package folders (each matching the target Roslyn version). Roslyn will automatically load the highest version compatible with Roslyn's version in the SDK. --> - - + + \ No newline at end of file From 2bc70f4d874c56f9e311aff46360a265bef8ebb1 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 12 Sep 2022 23:57:09 +0200 Subject: [PATCH 07/16] Fix embedded resource filenames --- .../Attributes/NullabilityAttributesGenerator.cs | 2 +- .../CommunityToolkit.Mvvm.SourceGenerators.projitems | 5 +++++ .../ComponentModel/TransitiveMembersGenerator.Execute.cs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Attributes/NullabilityAttributesGenerator.cs b/CommunityToolkit.Mvvm.SourceGenerators/Attributes/NullabilityAttributesGenerator.cs index cfb540200..2ee576beb 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/Attributes/NullabilityAttributesGenerator.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/Attributes/NullabilityAttributesGenerator.cs @@ -67,7 +67,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) private static string LoadAttributeSourceWithMetadataName(string typeFullName) { string typeName = typeFullName.Split('.').Last(); - string filename = $"CommunityToolkit.Mvvm.SourceGenerators.EmbeddedResources.{typeName}.cs"; + string filename = $"{typeName}.cs"; Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename); StreamReader reader = new(stream); diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems index e77dddec7..d8cb8dfb6 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems +++ b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.projitems @@ -11,18 +11,23 @@ PreserveNewest + INotifyPropertyChanged.cs PreserveNewest + NotNullAttribute.cs PreserveNewest + NotNullIfNotNullAttribute.cs PreserveNewest + ObservableObject.cs PreserveNewest + ObservableRecipient.cs diff --git a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.Execute.cs b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.Execute.cs index ba20b98e5..855a7e36b 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.Execute.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.Execute.cs @@ -31,7 +31,7 @@ internal static class Execute public static ClassDeclarationSyntax LoadClassDeclaration(string attributeType) { string attributeTypeName = attributeType.Split('.').Last(); - string filename = $"CommunityToolkit.Mvvm.SourceGenerators.EmbeddedResources.{attributeTypeName.Replace("Attribute", string.Empty)}.cs"; + string filename = $"{attributeTypeName.Replace("Attribute", string.Empty)}.cs"; using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename); using StreamReader reader = new(stream); From 65110da12c9a6458229462c2d592642350c6ec91 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 13 Sep 2022 13:33:05 +0200 Subject: [PATCH 08/16] Restructure test projects into shared projects for multi-targeting --- azure-pipelines.yml | 8 - dotnet Community Toolkit.sln | 227 ++++++++++++------ ...it.Mvvm.ExternalAssembly.Roslyn401.csproj} | 2 + ...kit.Mvvm.ExternalAssembly.Roslyn430.csproj | 20 ++ ...ityToolkit.Mvvm.ExternalAssembly.projitems | 16 ++ ...munityToolkit.Mvvm.ExternalAssembly.shproj | 13 + ...tyToolkit.Mvvm.Roslyn401.UnitTests.csproj} | 4 +- ...ityToolkit.Mvvm.Roslyn430.UnitTests.csproj | 22 ++ ...urceGenerators.Roslyn401.UnitTests.csproj} | 12 +- ...ourceGenerators.Roslyn430.UnitTests.csproj | 22 ++ ....Mvvm.SourceGenerators.UnitTests.projitems | 15 ++ ...kit.Mvvm.SourceGenerators.UnitTests.shproj | 13 + .../CommunityToolkit.Mvvm.UnitTests.projitems | 42 ++++ .../CommunityToolkit.Mvvm.UnitTests.shproj | 13 + 14 files changed, 345 insertions(+), 84 deletions(-) rename tests/{CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj => CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401.csproj} (86%) create mode 100644 tests/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430.csproj create mode 100644 tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.projitems create mode 100644 tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.shproj rename tests/{CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj => CommunityToolkit.Mvvm.Roslyn401.UnitTests/CommunityToolkit.Mvvm.Roslyn401.UnitTests.csproj} (82%) create mode 100644 tests/CommunityToolkit.Mvvm.Roslyn430.UnitTests/CommunityToolkit.Mvvm.Roslyn430.UnitTests.csproj rename tests/{CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj => CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj} (76%) create mode 100644 tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj create mode 100644 tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems create mode 100644 tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.shproj create mode 100644 tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.projitems create mode 100644 tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.shproj diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd950a919..3287eb2df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,14 +46,6 @@ jobs: - script: dotnet test -c Release -f net6.0 -l "trx;LogFileName=VSTestResults_net6.0.trx" displayName: Run .NET 6 unit tests - # Run the .NET 6 MVVM Toolkit tests targeting Roslyn 4.3.0 - - script: dotnet test tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.csproj -c Release -f net6.0 -p:MvvmToolkitSourceGeneratorRoslynVersion=4.3.0 -l "trx;LogFileName=VSTestResults_net6.0_mvvmtoolkit_roslyn430.trx" - displayName: Run CommunityToolkit.Mvvm.UnitTests unit tests with Roslyn 4.3.0 - - # Run the .NET 6 MVVM Toolkit source generator tests targeting Roslyn 4.3.0 - - script: dotnet test tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj -c Release -f net6.0 -p:MvvmToolkitSourceGeneratorRoslynVersion=4.3.0 -l "trx;LogFileName=VSTestResults_net6.0_mvvmtoolkit_generators_roslyn430.trx" - displayName: Run CommunityToolkit.Mvvm.SourceGenerators.UnitTests unit tests with Roslyn 4.3.0 - # Run .NET Core 3.1 tests - script: dotnet test -c Release -f netcoreapp3.1 -l "trx;LogFileName=VSTestResults_netcoreapp3.1.trx" displayName: Run .NET Core 3.1 unit tests diff --git a/dotnet Community Toolkit.sln b/dotnet Community Toolkit.sln index 66460e318..621fdbd52 100644 --- a/dotnet Community Toolkit.sln +++ b/dotnet Community Toolkit.sln @@ -38,14 +38,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Diagnostic EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators.Roslyn401", "CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj", "{E24D1146-5AD8-498F-A518-4890D8BF4937}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators.UnitTests", "tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj", "{338C3BE4-2E71-4F21-AD30-03FDBB47A272}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.ExternalAssembly", "tests\CommunityToolkit.Mvvm.ExternalAssembly\CommunityToolkit.Mvvm.ExternalAssembly.csproj", "{D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Diagnostics.UnitTests", "tests\CommunityToolkit.Diagnostics.UnitTests\CommunityToolkit.Diagnostics.UnitTests.csproj", "{35E48D4D-6433-4B70-98A9-BA544921EE04}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.UnitTests", "tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.csproj", "{59212E0A-878C-4097-A1CE-58CE3375F8D7}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Common.UnitTests", "tests\CommunityToolkit.Common.UnitTests\CommunityToolkit.Common.UnitTests.csproj", "{17522D0B-CA70-40B6-AFD8-8B8D45E75D92}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CD16E790-7B7B-411E-9CE7-768E759CC22D}" @@ -67,7 +61,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.Inter EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CommunityToolkit.Mvvm.SourceGenerators", "CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.shproj", "{5E7F1212-A54B-40CA-98C5-1FF5CD1A1638}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Mvvm.SourceGenerators.Roslyn430", "CommunityToolkit.Mvvm.SourceGenerators.Roslyn430\CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.csproj", "{DF455C40-B18E-4890-8758-7CCCB5CA7052}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators.Roslyn430", "CommunityToolkit.Mvvm.SourceGenerators.Roslyn430\CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.csproj", "{DF455C40-B18E-4890-8758-7CCCB5CA7052}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CommunityToolkit.Mvvm.UnitTests", "tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.shproj", "{B8DCD82E-B53B-4249-AD4E-F9B99ACB9334}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.Roslyn401.UnitTests", "tests\CommunityToolkit.Mvvm.Roslyn401.UnitTests\CommunityToolkit.Mvvm.Roslyn401.UnitTests.csproj", "{AD9C3223-8E37-4FD4-A0D4-A45119551D3A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.Roslyn430.UnitTests", "tests\CommunityToolkit.Mvvm.Roslyn430.UnitTests\CommunityToolkit.Mvvm.Roslyn430.UnitTests.csproj", "{5B44F7F1-DCA2-4776-924E-A266F7BBF753}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CommunityToolkit.Mvvm.SourceGenerators.UnitTests", "tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.shproj", "{FB59CE88-7732-4A63-B5BD-AC5681B7DA1A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests", "tests\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj", "{F3799252-7A66-4533-89D8-B3C312052D95}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests", "tests\CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj", "{FE3EA695-EA0F-4E5F-9257-E059AAA23B10}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CommunityToolkit.Mvvm.ExternalAssembly", "tests\CommunityToolkit.Mvvm.ExternalAssembly\CommunityToolkit.Mvvm.ExternalAssembly.shproj", "{E827A9CD-405F-43E4-84C7-68CC7E845CDC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401", "tests\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401.csproj", "{ECFE93AA-4B98-4292-B3FA-9430D513B4F9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430", "tests\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430.csproj", "{4FCD501C-1BB5-465C-AD19-356DAB6600C6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -203,46 +215,6 @@ Global {E24D1146-5AD8-498F-A518-4890D8BF4937}.Release|x64.Build.0 = Release|Any CPU {E24D1146-5AD8-498F-A518-4890D8BF4937}.Release|x86.ActiveCfg = Release|Any CPU {E24D1146-5AD8-498F-A518-4890D8BF4937}.Release|x86.Build.0 = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|Any CPU.Build.0 = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|ARM.ActiveCfg = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|ARM.Build.0 = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|ARM64.Build.0 = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|x64.ActiveCfg = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|x64.Build.0 = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|x86.ActiveCfg = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Debug|x86.Build.0 = Debug|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|Any CPU.ActiveCfg = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|Any CPU.Build.0 = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|ARM.ActiveCfg = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|ARM.Build.0 = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|ARM64.ActiveCfg = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|ARM64.Build.0 = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|x64.ActiveCfg = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|x64.Build.0 = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|x86.ActiveCfg = Release|Any CPU - {338C3BE4-2E71-4F21-AD30-03FDBB47A272}.Release|x86.Build.0 = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|ARM.ActiveCfg = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|ARM.Build.0 = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|ARM64.Build.0 = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|x64.ActiveCfg = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|x64.Build.0 = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|x86.ActiveCfg = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Debug|x86.Build.0 = Debug|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|Any CPU.Build.0 = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|ARM.ActiveCfg = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|ARM.Build.0 = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|ARM64.ActiveCfg = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|ARM64.Build.0 = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|x64.ActiveCfg = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|x64.Build.0 = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|x86.ActiveCfg = Release|Any CPU - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1}.Release|x86.Build.0 = Release|Any CPU {35E48D4D-6433-4B70-98A9-BA544921EE04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {35E48D4D-6433-4B70-98A9-BA544921EE04}.Debug|Any CPU.Build.0 = Debug|Any CPU {35E48D4D-6433-4B70-98A9-BA544921EE04}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -263,26 +235,6 @@ Global {35E48D4D-6433-4B70-98A9-BA544921EE04}.Release|x64.Build.0 = Release|Any CPU {35E48D4D-6433-4B70-98A9-BA544921EE04}.Release|x86.ActiveCfg = Release|Any CPU {35E48D4D-6433-4B70-98A9-BA544921EE04}.Release|x86.Build.0 = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|ARM.ActiveCfg = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|ARM.Build.0 = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|ARM64.Build.0 = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|x64.ActiveCfg = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|x64.Build.0 = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|x86.ActiveCfg = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Debug|x86.Build.0 = Debug|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|Any CPU.Build.0 = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|ARM.ActiveCfg = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|ARM.Build.0 = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|ARM64.ActiveCfg = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|ARM64.Build.0 = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|x64.ActiveCfg = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|x64.Build.0 = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|x86.ActiveCfg = Release|Any CPU - {59212E0A-878C-4097-A1CE-58CE3375F8D7}.Release|x86.Build.0 = Release|Any CPU {17522D0B-CA70-40B6-AFD8-8B8D45E75D92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {17522D0B-CA70-40B6-AFD8-8B8D45E75D92}.Debug|Any CPU.Build.0 = Debug|Any CPU {17522D0B-CA70-40B6-AFD8-8B8D45E75D92}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -363,6 +315,126 @@ Global {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|x64.Build.0 = Release|Any CPU {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|x86.ActiveCfg = Release|Any CPU {DF455C40-B18E-4890-8758-7CCCB5CA7052}.Release|x86.Build.0 = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|ARM.Build.0 = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|ARM64.Build.0 = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|x64.ActiveCfg = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|x64.Build.0 = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|x86.ActiveCfg = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Debug|x86.Build.0 = Debug|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|Any CPU.Build.0 = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|ARM.ActiveCfg = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|ARM.Build.0 = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|ARM64.ActiveCfg = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|ARM64.Build.0 = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|x64.ActiveCfg = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|x64.Build.0 = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|x86.ActiveCfg = Release|Any CPU + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A}.Release|x86.Build.0 = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|ARM.ActiveCfg = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|ARM.Build.0 = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|ARM64.Build.0 = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|x64.ActiveCfg = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|x64.Build.0 = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|x86.ActiveCfg = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Debug|x86.Build.0 = Debug|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|Any CPU.Build.0 = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|ARM.ActiveCfg = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|ARM.Build.0 = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|ARM64.ActiveCfg = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|ARM64.Build.0 = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|x64.ActiveCfg = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|x64.Build.0 = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|x86.ActiveCfg = Release|Any CPU + {5B44F7F1-DCA2-4776-924E-A266F7BBF753}.Release|x86.Build.0 = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|ARM.ActiveCfg = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|ARM.Build.0 = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|ARM64.Build.0 = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|x64.ActiveCfg = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|x64.Build.0 = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|x86.ActiveCfg = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Debug|x86.Build.0 = Debug|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|Any CPU.Build.0 = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|ARM.ActiveCfg = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|ARM.Build.0 = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|ARM64.ActiveCfg = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|ARM64.Build.0 = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|x64.ActiveCfg = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|x64.Build.0 = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|x86.ActiveCfg = Release|Any CPU + {F3799252-7A66-4533-89D8-B3C312052D95}.Release|x86.Build.0 = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|ARM.ActiveCfg = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|ARM.Build.0 = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|ARM64.Build.0 = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|x64.ActiveCfg = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|x64.Build.0 = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|x86.ActiveCfg = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Debug|x86.Build.0 = Debug|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|Any CPU.Build.0 = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|ARM.ActiveCfg = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|ARM.Build.0 = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|ARM64.ActiveCfg = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|ARM64.Build.0 = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|x64.ActiveCfg = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|x64.Build.0 = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|x86.ActiveCfg = Release|Any CPU + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10}.Release|x86.Build.0 = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|ARM.ActiveCfg = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|ARM.Build.0 = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|ARM64.Build.0 = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|x64.ActiveCfg = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|x64.Build.0 = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|x86.ActiveCfg = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Debug|x86.Build.0 = Debug|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|Any CPU.Build.0 = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|ARM.ActiveCfg = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|ARM.Build.0 = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|ARM64.ActiveCfg = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|ARM64.Build.0 = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|x64.ActiveCfg = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|x64.Build.0 = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|x86.ActiveCfg = Release|Any CPU + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9}.Release|x86.Build.0 = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|ARM.ActiveCfg = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|ARM.Build.0 = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|ARM64.Build.0 = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|x64.ActiveCfg = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|x64.Build.0 = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|x86.ActiveCfg = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Debug|x86.Build.0 = Debug|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|Any CPU.Build.0 = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|ARM.ActiveCfg = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|ARM.Build.0 = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|ARM64.ActiveCfg = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|ARM64.Build.0 = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|x64.ActiveCfg = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|x64.Build.0 = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|x86.ActiveCfg = Release|Any CPU + {4FCD501C-1BB5-465C-AD19-356DAB6600C6}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -370,22 +442,37 @@ Global GlobalSection(NestedProjects) = preSolution {D9BDBC68-3D0A-47FC-9C88-0BF769101644} = {B30036C4-D514-4E5B-A323-587A061772CE} {88C6FFBE-322D-4CEA-842B-B2CB281D357D} = {CFA75BE0-5A44-45DE-8114-426A605B062B} - {338C3BE4-2E71-4F21-AD30-03FDBB47A272} = {B30036C4-D514-4E5B-A323-587A061772CE} - {D9C82C0D-31D7-4888-B024-3CF3A4F54FE1} = {B30036C4-D514-4E5B-A323-587A061772CE} {35E48D4D-6433-4B70-98A9-BA544921EE04} = {B30036C4-D514-4E5B-A323-587A061772CE} - {59212E0A-878C-4097-A1CE-58CE3375F8D7} = {B30036C4-D514-4E5B-A323-587A061772CE} {17522D0B-CA70-40B6-AFD8-8B8D45E75D92} = {B30036C4-D514-4E5B-A323-587A061772CE} {CD16E790-7B7B-411E-9CE7-768E759CC22D} = {CFA75BE0-5A44-45DE-8114-426A605B062B} {6640D447-C28D-4DBB-91F4-3ADCE0CA64AD} = {B30036C4-D514-4E5B-A323-587A061772CE} {9E09DA49-4389-4ECE-8B68-EBDB1221DA90} = {6640D447-C28D-4DBB-91F4-3ADCE0CA64AD} {743D74BA-12AE-4639-AD77-B9DDA9C03255} = {B30036C4-D514-4E5B-A323-587A061772CE} + {B8DCD82E-B53B-4249-AD4E-F9B99ACB9334} = {B30036C4-D514-4E5B-A323-587A061772CE} + {AD9C3223-8E37-4FD4-A0D4-A45119551D3A} = {B30036C4-D514-4E5B-A323-587A061772CE} + {5B44F7F1-DCA2-4776-924E-A266F7BBF753} = {B30036C4-D514-4E5B-A323-587A061772CE} + {FB59CE88-7732-4A63-B5BD-AC5681B7DA1A} = {B30036C4-D514-4E5B-A323-587A061772CE} + {F3799252-7A66-4533-89D8-B3C312052D95} = {B30036C4-D514-4E5B-A323-587A061772CE} + {FE3EA695-EA0F-4E5F-9257-E059AAA23B10} = {B30036C4-D514-4E5B-A323-587A061772CE} + {E827A9CD-405F-43E4-84C7-68CC7E845CDC} = {B30036C4-D514-4E5B-A323-587A061772CE} + {ECFE93AA-4B98-4292-B3FA-9430D513B4F9} = {B30036C4-D514-4E5B-A323-587A061772CE} + {4FCD501C-1BB5-465C-AD19-356DAB6600C6} = {B30036C4-D514-4E5B-A323-587A061772CE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5403B0C4-F244-4F73-A35C-FE664D0F4345} EndGlobalSection GlobalSection(SharedMSBuildProjectFiles) = preSolution + tests\CommunityToolkit.Mvvm.ExternalAssembly\CommunityToolkit.Mvvm.ExternalAssembly.projitems*{4fcd501c-1bb5-465c-ad19-356dab6600c6}*SharedItemsImports = 5 + tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.projitems*{5b44f7f1-dca2-4776-924e-a266f7bbf753}*SharedItemsImports = 5 CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.projitems*{5e7f1212-a54b-40ca-98c5-1ff5cd1a1638}*SharedItemsImports = 13 + tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.projitems*{ad9c3223-8e37-4fd4-a0d4-a45119551d3a}*SharedItemsImports = 5 + tests\CommunityToolkit.Mvvm.UnitTests\CommunityToolkit.Mvvm.UnitTests.projitems*{b8dcd82e-b53b-4249-ad4e-f9b99acb9334}*SharedItemsImports = 13 CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.projitems*{df455c40-b18e-4890-8758-7cccb5ca7052}*SharedItemsImports = 5 CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.projitems*{e24d1146-5ad8-498f-a518-4890d8bf4937}*SharedItemsImports = 5 + tests\CommunityToolkit.Mvvm.ExternalAssembly\CommunityToolkit.Mvvm.ExternalAssembly.projitems*{e827a9cd-405f-43e4-84c7-68cc7e845cdc}*SharedItemsImports = 13 + tests\CommunityToolkit.Mvvm.ExternalAssembly\CommunityToolkit.Mvvm.ExternalAssembly.projitems*{ecfe93aa-4b98-4292-b3fa-9430d513b4f9}*SharedItemsImports = 5 + tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems*{f3799252-7a66-4533-89d8-b3c312052d95}*SharedItemsImports = 5 + tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems*{fb59ce88-7732-4a63-b5bd-ac5681b7da1a}*SharedItemsImports = 13 + tests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems*{fe3ea695-ea0f-4e5f-9257-e059aaa23b10}*SharedItemsImports = 5 EndGlobalSection EndGlobal diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj b/tests/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401.csproj similarity index 86% rename from tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj rename to tests/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401.csproj index d486f9f95..a774ed5e5 100644 --- a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.csproj +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn401.csproj @@ -17,4 +17,6 @@ + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430.csproj b/tests/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430.csproj new file mode 100644 index 000000000..d30083551 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430/CommunityToolkit.Mvvm.ExternalAssembly.Roslyn430.csproj @@ -0,0 +1,20 @@ + + + + netstandard2.0 + + + + false + false + $(NoWarn);CS8002;SA0001 + + + + + + + + + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.projitems b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.projitems new file mode 100644 index 000000000..c4ecf6dc4 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.projitems @@ -0,0 +1,16 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + e827a9cd-405f-43e4-84c7-68cc7e845cdc + + + CommunityToolkit.Mvvm.ExternalAssembly + + + + + + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.shproj b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.shproj new file mode 100644 index 000000000..fd605fe42 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly/CommunityToolkit.Mvvm.ExternalAssembly.shproj @@ -0,0 +1,13 @@ + + + + e827a9cd-405f-43e4-84c7-68cc7e845cdc + 14.0 + + + + + + + + diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.Roslyn401.UnitTests/CommunityToolkit.Mvvm.Roslyn401.UnitTests.csproj similarity index 82% rename from tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj rename to tests/CommunityToolkit.Mvvm.Roslyn401.UnitTests/CommunityToolkit.Mvvm.Roslyn401.UnitTests.csproj index 00fc48e97..c704c2286 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.Roslyn401.UnitTests/CommunityToolkit.Mvvm.Roslyn401.UnitTests.csproj @@ -12,9 +12,11 @@ - + + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.Roslyn430.UnitTests/CommunityToolkit.Mvvm.Roslyn430.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.Roslyn430.UnitTests/CommunityToolkit.Mvvm.Roslyn430.UnitTests.csproj new file mode 100644 index 000000000..b7bf9673f --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.Roslyn430.UnitTests/CommunityToolkit.Mvvm.Roslyn430.UnitTests.csproj @@ -0,0 +1,22 @@ + + + + net472;netcoreapp3.1;net6.0 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj similarity index 76% rename from tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj rename to tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj index fefce4441..db2550ffd 100644 --- a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj @@ -1,4 +1,4 @@ - + net472;netcoreapp3.1;net6.0 @@ -6,10 +6,10 @@ - - - - + + + + @@ -17,4 +17,6 @@ + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj new file mode 100644 index 000000000..e54a63669 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj @@ -0,0 +1,22 @@ + + + + net472;netcoreapp3.1;net6.0 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems new file mode 100644 index 000000000..ab60a1c18 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems @@ -0,0 +1,15 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + fb59ce88-7732-4a63-b5bd-ac5681b7da1a + + + CommunityToolkit.Mvvm.SourceGenerators.UnitTests + + + + + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.shproj b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.shproj new file mode 100644 index 000000000..5e904f534 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.shproj @@ -0,0 +1,13 @@ + + + + fb59ce88-7732-4a63-b5bd-ac5681b7da1a + 14.0 + + + + + + + + diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.projitems b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.projitems new file mode 100644 index 000000000..276665389 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.projitems @@ -0,0 +1,42 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + b8dcd82e-b53b-4249-ad4e-f9b99acb9334 + + + CommunityToolkit.Mvvm.UnitTests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.shproj b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.shproj new file mode 100644 index 000000000..b16b0e5e2 --- /dev/null +++ b/tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.shproj @@ -0,0 +1,13 @@ + + + + b8dcd82e-b53b-4249-ad4e-f9b99acb9334 + 14.0 + + + + + + + + From faf1061c900db6dc4db7968009332995e83ebb5a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 15 Sep 2022 01:20:42 +0200 Subject: [PATCH 09/16] Add workaround for Roslyn 4.3 issues --- .../CommunityToolkit.Mvvm.SourceGenerators.props | 7 +++++-- .../Extensions/ISymbolExtensions.cs | 4 ++-- .../Polyfills/GeneratorAttributeSyntaxContext.cs | 2 +- .../Polyfills/SyntaxValueProviderExtensions.cs | 2 +- CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj | 3 ++- ...oolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props index 4b61b402b..342f1a80d 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props +++ b/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props @@ -27,8 +27,11 @@ $(MSBuildProjectName.Substring($([MSBuild]::Subtract($(MSBuildProjectName.Length), 1)), 1)) $(MvvmToolkitSourceGeneratorRoslynMajorVersion).$(MvvmToolkitSourceGeneratorRoslynMinorVersion).$(MvvmToolkitSourceGeneratorRoslynPatchVersion) - - $(DefineConstants);ROSLYN_$(MvvmToolkitSourceGeneratorRoslynVersion.Substring(0, 3).Replace('.', '_')) + + 4.4.0-1.final + + + $(DefineConstants);ROSLYN_4_3_0_OR_GREATER diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs b/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs index 8460e4afb..4a29ba7e7 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/Extensions/ISymbolExtensions.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Immutable; -#if !ROSLYN_4_3 +#if !ROSLYN_4_3_0_OR_GREATER using System.Diagnostics.CodeAnalysis; #endif using Microsoft.CodeAnalysis; @@ -67,7 +67,7 @@ public static bool HasAttributeWithFullyQualifiedName(this ISymbol symbol, strin return false; } -#if !ROSLYN_4_3 +#if !ROSLYN_4_3_0_OR_GREATER /// /// Tries to get an attribute with the specified full name. /// diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs index 33c62318c..afa10900a 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/GeneratorAttributeSyntaxContext.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !ROSLYN_4_3 +#if !ROSLYN_4_3_0_OR_GREATER using System.Collections.Immutable; diff --git a/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs index aaea1fd4c..492d5ea26 100644 --- a/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs +++ b/CommunityToolkit.Mvvm.SourceGenerators/Polyfills/SyntaxValueProviderExtensions.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !ROSLYN_4_3 +#if !ROSLYN_4_3_0_OR_GREATER using System.Threading; using System; diff --git a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj index 98432bec2..31fade695 100644 --- a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj +++ b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj @@ -57,9 +57,10 @@ - + \ No newline at end of file diff --git a/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj b/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj index e54a63669..b49c520a6 100644 --- a/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj +++ b/tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn430.UnitTests.csproj @@ -6,7 +6,7 @@ - + From 80b748f71a4100244b8839b74984e4c0f760eddd Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 15 Sep 2022 01:26:21 +0200 Subject: [PATCH 10/16] Suppress IL2091 warnings where not needed --- .../ConditionalWeakTable2{TKey,TValue}.ZeroAlloc.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CommunityToolkit.Mvvm/Messaging/Internals/System/Runtime.CompilerServices/ConditionalWeakTable2{TKey,TValue}.ZeroAlloc.cs b/CommunityToolkit.Mvvm/Messaging/Internals/System/Runtime.CompilerServices/ConditionalWeakTable2{TKey,TValue}.ZeroAlloc.cs index 666a1c5ce..882b6bf50 100644 --- a/CommunityToolkit.Mvvm/Messaging/Internals/System/Runtime.CompilerServices/ConditionalWeakTable2{TKey,TValue}.ZeroAlloc.cs +++ b/CommunityToolkit.Mvvm/Messaging/Internals/System/Runtime.CompilerServices/ConditionalWeakTable2{TKey,TValue}.ZeroAlloc.cs @@ -83,6 +83,10 @@ public bool Remove(TKey key) } /// + [UnconditionalSuppressMessage( + "ReflectionAnalysis", + "IL2091", + Justification = "ConditionalWeakTable is only referenced to reuse the callback delegate type, but no value is ever created through reflection.")] public TValue GetValue(TKey key, ConditionalWeakTable.CreateValueCallback createValueCallback) { return TryGetValue(key, out TValue? existingValue) ? @@ -96,6 +100,10 @@ public TValue GetValue(TKey key, ConditionalWeakTable.CreateValueC /// The input key. /// The callback to use to create a new item. /// The new item to store. + [UnconditionalSuppressMessage( + "ReflectionAnalysis", + "IL2091", + Justification = "ConditionalWeakTable is only referenced to reuse the callback delegate type, but no value is ever created through reflection.")] private TValue GetValueLocked(TKey key, ConditionalWeakTable.CreateValueCallback createValueCallback) { // If we got here, the key was not in the table. Invoke the callback From 3affd935ee22abc1cdc7383272261e1c4a34cd17 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 16 Sep 2022 03:44:05 +0200 Subject: [PATCH 11/16] Install .NET SDK from CI script --- azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3287eb2df..70da0a4c5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,13 @@ jobs: timeoutInMinutes: 60 steps: + # Install the .NET 7 SDK + - task: UseDotNet@2 + displayName: Install the .NET 7 SDK + inputs: + version: 7.0.x + includePreviewVersions: true + # Install NuGet - task: NuGetToolInstaller@0 displayName: Install NuGet 6.0 From d1bce29fbca984e6ef3ced6075b6198421b45e81 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 16 Sep 2022 04:02:42 +0200 Subject: [PATCH 12/16] Workaround for ILLinker analyzer crash, fix trimming annotations --- CommunityToolkit.Common/Extensions/TaskExtensions.cs | 6 ++---- CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CommunityToolkit.Common/Extensions/TaskExtensions.cs b/CommunityToolkit.Common/Extensions/TaskExtensions.cs index 07eac6db4..fd59fdd65 100644 --- a/CommunityToolkit.Common/Extensions/TaskExtensions.cs +++ b/CommunityToolkit.Common/Extensions/TaskExtensions.cs @@ -26,12 +26,10 @@ public static class TaskExtensions /// and uses reflection to access the property and boxes the result if it's /// a value type, which adds overhead. It should only be used when using generics is not possible. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static object? GetResultOrDefault( #if NET6_0_OR_GREATER - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] + [RequiresUnreferencedCode("This method uses reflection to try to access the Task.Result property of the input Task instance.")] #endif - this Task task) + public static object? GetResultOrDefault(this Task task) { // Check if the instance is a completed Task if ( diff --git a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj index 31fade695..d48535781 100644 --- a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj +++ b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj @@ -36,7 +36,9 @@ - true + + + false true From 338172af682a5910ca33962211be1751d0dd2008 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 16 Sep 2022 04:04:21 +0200 Subject: [PATCH 13/16] Suppress CA1001 warnings in MVVM Toolkit --- CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs | 2 +- CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs | 2 +- .../Messaging/Messages/AsyncCollectionRequestMessage{T}.cs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs b/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs index 8b38c24e9..ed877ed52 100644 --- a/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs +++ b/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs @@ -10,7 +10,7 @@ using CommunityToolkit.Mvvm.ComponentModel.__Internals; using CommunityToolkit.Mvvm.Input.Internals; -#pragma warning disable CS0618 +#pragma warning disable CS0618, CA1001 namespace CommunityToolkit.Mvvm.Input; diff --git a/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs b/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs index 8e914dc04..a2b3d7f96 100644 --- a/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs +++ b/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs @@ -10,7 +10,7 @@ using CommunityToolkit.Mvvm.ComponentModel.__Internals; using CommunityToolkit.Mvvm.Input.Internals; -#pragma warning disable CS0618 +#pragma warning disable CS0618, CA1001 namespace CommunityToolkit.Mvvm.Input; diff --git a/CommunityToolkit.Mvvm/Messaging/Messages/AsyncCollectionRequestMessage{T}.cs b/CommunityToolkit.Mvvm/Messaging/Messages/AsyncCollectionRequestMessage{T}.cs index aec986fe8..28e66754b 100644 --- a/CommunityToolkit.Mvvm/Messaging/Messages/AsyncCollectionRequestMessage{T}.cs +++ b/CommunityToolkit.Mvvm/Messaging/Messages/AsyncCollectionRequestMessage{T}.cs @@ -8,6 +8,8 @@ using System.Threading; using System.Threading.Tasks; +#pragma warning disable CA1001 + namespace CommunityToolkit.Mvvm.Messaging.Messages; /// From 20940ee744ef134368a162e1aabfb89570adee83 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 16 Sep 2022 12:32:41 +0200 Subject: [PATCH 14/16] Suppress CA2252 warnings --- .../CommunityToolkit.HighPerformance.UnitTests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/CommunityToolkit.HighPerformance.UnitTests/CommunityToolkit.HighPerformance.UnitTests.csproj b/tests/CommunityToolkit.HighPerformance.UnitTests/CommunityToolkit.HighPerformance.UnitTests.csproj index e09447c38..2e03242b3 100644 --- a/tests/CommunityToolkit.HighPerformance.UnitTests/CommunityToolkit.HighPerformance.UnitTests.csproj +++ b/tests/CommunityToolkit.HighPerformance.UnitTests/CommunityToolkit.HighPerformance.UnitTests.csproj @@ -3,6 +3,7 @@ net472;netcoreapp3.1;net6.0 true + $(NoWarn);CA2252 From 9ad0e4bcc7cb5e43d70ead41b4055e501af3782b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 16 Sep 2022 12:46:44 +0200 Subject: [PATCH 15/16] Install the .NET 6 SDK in CI script --- azure-pipelines.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 70da0a4c5..b7f8123c2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,12 @@ jobs: timeoutInMinutes: 60 steps: + # Install the .NET 6 SDK + - task: UseDotNet@2 + displayName: Install the .NET 6 SDK + inputs: + version: 6.0.x + # Install the .NET 7 SDK - task: UseDotNet@2 displayName: Install the .NET 7 SDK From f50c392037cfff08258db4893d9bd9b6cc8a8a34 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 16 Sep 2022 13:24:25 +0200 Subject: [PATCH 16/16] Install the .NET Core 3.1 SDK in CI script --- azure-pipelines.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b7f8123c2..47dccdaf7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,12 @@ jobs: timeoutInMinutes: 60 steps: + # Install the .NET Core 3.1 SDK + - task: UseDotNet@2 + displayName: Install the .NET Core 3.1 SDK + inputs: + version: 3.1.x + # Install the .NET 6 SDK - task: UseDotNet@2 displayName: Install the .NET 6 SDK