diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d5db1da8c..85344154b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -257,7 +257,8 @@ jobs: # check vulnerabilities - powershell: | - dotnet list $(PathToLibrarySolution) package --vulnerable --include-transitive | findstr /S /c:"has the following vulnerable packages"; + dotnet list $(PathToLibrarySolution) package --include-transitive # Print all transitive packages + dotnet list $(PathToLibrarySolution) package --vulnerable --include-transitive | findstr /S /c:"has the following vulnerable packages"; # Print all transitive packages with vulnerabilities if ($LastExitCode -ne 1) { dotnet list $(PathToLibrarySolution) package --vulnerable --include-transitive; diff --git a/src/CommunityToolkit.Maui.Core/CommunityToolkit.Maui.Core.csproj b/src/CommunityToolkit.Maui.Core/CommunityToolkit.Maui.Core.csproj index 528fa0de9..af5e0bacf 100644 --- a/src/CommunityToolkit.Maui.Core/CommunityToolkit.Maui.Core.csproj +++ b/src/CommunityToolkit.Maui.Core/CommunityToolkit.Maui.Core.csproj @@ -50,6 +50,10 @@ + + + + all diff --git a/src/CommunityToolkit.Maui.SourceGenerators/Generators/TextColorToGenerator.cs b/src/CommunityToolkit.Maui.SourceGenerators/Generators/TextColorToGenerator.cs index 47773f94d..ec5b3b803 100644 --- a/src/CommunityToolkit.Maui.SourceGenerators/Generators/TextColorToGenerator.cs +++ b/src/CommunityToolkit.Maui.SourceGenerators/Generators/TextColorToGenerator.cs @@ -68,7 +68,24 @@ public void Initialize(IncrementalGeneratorInitializationContext context) throw new Exception("There's no .NET MAUI referenced in the project."); } - var mauiAssembly = compilation.SourceModule.ReferencedAssemblySymbols.Single(q => q.Name == mauiControlsAssembly); + var mauiAssembly = default(IAssemblySymbol); + foreach (var assemblySymbol in compilation.SourceModule.ReferencedAssemblySymbols) + { + if (assemblySymbol.Name == mauiControlsAssembly) + { + if (mauiAssembly is not null) + { + throw new InvalidOperationException("There can only be one reference to the Maui Controls assembly."); + } + + mauiAssembly = assemblySymbol; + } + } + if (mauiAssembly is null) + { + throw new InvalidOperationException("There is no reference to the Maui Controls assembly."); + } + var symbols = GetMauiInterfaceImplementors(mauiAssembly, iAnimatableInterfaceSymbol, iTextStyleInterfaceSymbol).Where(static x => x is not null); return symbols;