From 67dcd7b0758b9cc6e4a266afba0f3e28ddd88727 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Wed, 24 Jun 2026 23:05:21 -0400 Subject: [PATCH 1/5] Refactored the logic for excluding assemblies The changes made before were not actually excluding Microsoft.CodeAnalysis which was causing issues with libraires that depended on this one. --- README.md | 19 +- src/Directory.Build.props | 3 +- .../ResourceTests.cs | 23 ++ .../FilterAssembliesTaskTests.cs | 32 +- .../FilterAssembliesTask.cs | 100 +++---- .../SourceGenerator.Foundations.csproj | 11 +- .../SourceGenerator.Foundations.props | 53 ++-- .../SourceGenerator.Foundations.targets | 5 +- ...rceGenerator.Foundations.MSBuild.deps.json | 274 ------------------ .../SourceGenerator.Foundations.MSBuild.dll | Bin 16896 -> 0 bytes .../SourceGenerator.Foundations.MSBuild.pdb | Bin 10092 -> 0 bytes 11 files changed, 142 insertions(+), 378 deletions(-) create mode 100644 src/Sandbox/ConsoleApp.SourceGenerator.Tests/ResourceTests.cs delete mode 100644 src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.deps.json delete mode 100644 src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.dll delete mode 100644 src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.pdb diff --git a/README.md b/README.md index 04cc286..7086822 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ This works well but requires a lot of boilerplate. Even worse is this is just fo *Source.Generator foundations automates this all for you. Just add your NuGet references and nothing else* -By default, SGF does **not** embed `Microsoft.CodeAnalysis.*` assemblies. Roslyn is provided by the compiler/IDE host at runtime, so embedding those assemblies can cause type identity conflicts and broken design-time behavior. +By default, SGF does **not** embed `Microsoft.CodeAnalysis.*` assemblies. Roslyn is provided by the compiler/IDE host at runtime, so embedding those assemblies can cause type identity conflicts and broken design-time behavior. This behavior is controlled through the `SGFExcludeAssemblyName` MSBuild item. ## Logging Framework Source generator run in the background and it can be very hard to debug. If you want to make a log you have to write the files to disk and open to read them. @@ -214,20 +214,23 @@ When your source generator runs it needs to find it's dependencies and this is o You can embed any assemblies you want by adding them to ``. -`Microsoft.CodeAnalysis.*` assemblies are excluded from SGF dependency embedding by default. If you need the previous behavior, opt in explicitly: +`Microsoft.CodeAnalysis.*` assemblies are excluded from SGF dependency embedding by default using `SGFExcludeAssemblyName`. + +To exclude additional assemblies from embedding, add to `SGFExcludeAssemblyName`: ```xml - - true - + + + + ``` -You can also exclude additional assemblies by name (with optional wildcard support): +If you want to embed Roslyn assemblies anyway, remove the default exclusions in your project: ```xml - - + + ``` diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 684c760..c8badfd 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -29,9 +29,8 @@ $(SGFSourceDir)Plugins\SourceGenerator.Foundations.Windows\ $(SGFWindowsPluginProjectDir)SourceGenerator.Foundations.Windows.csproj - - $(LibsDir)SourceGenerator.Foundations.MSBuild\SourceGenerator.Foundations.MSBuild.dll + $(SGFSourceDir)SourceGenerator.Foundations.MSBuild\bin\$(Configuration)\netstandard2.0\SourceGenerator.Foundations.MSBuild.dll diff --git a/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ResourceTests.cs b/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ResourceTests.cs new file mode 100644 index 0000000..8e6a156 --- /dev/null +++ b/src/Sandbox/ConsoleApp.SourceGenerator.Tests/ResourceTests.cs @@ -0,0 +1,23 @@ +using ConsoleApp.SourceGenerator; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace SGF +{ + public class ResourceTests + { + [Theory] + [InlineData("SGF.Assembly::Microsoft.CodeAnalysis.dll")] + [InlineData("SGF.Assembly::Microsoft.CodeAnalysis.CSharp.dll")] + public void Assembly_Does_Not_Contain_Resource(string resourceName) + { + Assembly assembly = typeof(ConsoleAppSourceGeneratorHoist).Assembly; + string[] resourceNames = assembly.GetManifestResourceNames(); + Assert.DoesNotContain(resourceName, resourceNames); + } + } +} diff --git a/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs b/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs index 87b3f26..bd183cc 100644 --- a/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs +++ b/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs @@ -12,7 +12,7 @@ public void ExcludesCodeAnalysisAssembliesByDefaultPattern() FilterAssembliesTask task = new FilterAssembliesTask { BuildEngine = new BuildEngineShim(), - IgnoredAssemblies = new TaskItem[] + ExcludedAssemblyNames = new TaskItem[] { new("Microsoft.CodeAnalysis*"), }, @@ -37,7 +37,7 @@ public void ExcludesNamedAssemblyWithoutExtension() FilterAssembliesTask task = new FilterAssembliesTask { BuildEngine = new BuildEngineShim(), - IgnoredAssemblies = new TaskItem[] + ExcludedAssemblyNames = new TaskItem[] { new("MyDependency"), }, @@ -61,7 +61,7 @@ public void IncludesAssembliesWhenNoIgnoredPatternMatches() FilterAssembliesTask task = new FilterAssembliesTask { BuildEngine = new BuildEngineShim(), - IgnoredAssemblies = new TaskItem[] + ExcludedAssemblyNames = new TaskItem[] { new("Does.Not.Match*"), }, @@ -85,7 +85,7 @@ public void ExcludesSpecificAssemblyFileName() FilterAssembliesTask task = new FilterAssembliesTask { BuildEngine = new BuildEngineShim(), - IgnoredAssemblies = new TaskItem[] + ExcludedAssemblyNames = new TaskItem[] { new("System.Collections.Immutable.dll"), }, @@ -103,6 +103,30 @@ public void ExcludesSpecificAssemblyFileName() Assert.Equal("/tmp/MyLibrary.dll", task.FilteredAssemblies[0].ItemSpec); } + [Fact] + public void ExcludesDottedAssemblyNameWithoutExtension() + { + FilterAssembliesTask task = new FilterAssembliesTask + { + BuildEngine = new BuildEngineShim(), + ExcludedAssemblyNames = new TaskItem[] + { + new("Microsoft.CodeAnalysis.CSharp"), + }, + Assemblies = new TaskItem[] + { + new("/tmp/Microsoft.CodeAnalysis.CSharp.dll"), + new("/tmp/MyLibrary.dll"), + } + }; + + bool result = task.Execute(); + + Assert.True(result); + Assert.Single(task.FilteredAssemblies); + Assert.Equal("/tmp/MyLibrary.dll", task.FilteredAssemblies[0].ItemSpec); + } + [Fact] public void ExcludesNetStandardLibraryAssemblies() { diff --git a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs b/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs index 273c0f5..c9230f0 100644 --- a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs +++ b/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs @@ -2,7 +2,9 @@ using Microsoft.Build.Utilities; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; +using System.Linq; using System.Text.RegularExpressions; namespace SourceGenerator.Foundations.MSBuild @@ -15,7 +17,7 @@ namespace SourceGenerator.Foundations.MSBuild /// public class FilterAssembliesTask : Task, ITask { - private readonly string m_netStandardPatttern; + private readonly string m_netStandardPattern; /// /// The list of assemblies that we can filter out @@ -24,9 +26,12 @@ public class FilterAssembliesTask : Task, ITask public ITaskItem[] Assemblies { get; set; } /// - /// Assembly names or wildcard patterns that should not be embedded. + /// Gets the list of assemblies that have been excluded from the list. + /// This is used to filter out assemblies that should not be embedded. This are based on the assembly name + /// not the full path /// - public ITaskItem[] IgnoredAssemblies { get; set; } + [Required] + public ITaskItem[] ExcludedAssemblyNames { get; set; } /// /// The filtered version of @@ -36,11 +41,10 @@ public class FilterAssembliesTask : Task, ITask public FilterAssembliesTask() { - Assemblies = Array.Empty(); - IgnoredAssemblies = Array.Empty(); + Assemblies = Array.Empty(); + ExcludedAssemblyNames = Array.Empty(); FilteredAssemblies = Array.Empty(); - - m_netStandardPatttern = $"{Path.DirectorySeparatorChar}netstandard.library{Path.DirectorySeparatorChar}"; + m_netStandardPattern = $"{Path.DirectorySeparatorChar}netstandard.library{Path.DirectorySeparatorChar}"; } /// @@ -48,81 +52,55 @@ public override bool Execute() { List filtered = new List(Assemblies.Length); - foreach (ITaskItem assembly in Assemblies) + HashSet excludedAssemblyNames = new HashSet(ExcludedAssemblyNames + .Select(GetAssemblyName), + StringComparer.OrdinalIgnoreCase); + + + foreach (ITaskItem sourceAssembly in Assemblies) { - string assemblyPath = assembly.ItemSpec; + string assemblyPath = sourceAssembly.ItemSpec; + string assemblyName = GetAssemblyName(sourceAssembly); + if (string.IsNullOrWhiteSpace(assemblyPath)) { continue; } - if (Include(assemblyPath)) + if (assemblyPath.IndexOf(m_netStandardPattern, StringComparison.OrdinalIgnoreCase) > 0) { - filtered.Add(assembly); - Log.LogMessage(MessageImportance.Normal, "Added: {0}", assemblyPath); + // Skipping netstandard.library assemblies as they are part of the .NET Standard framework and should not be embedded. + continue; } - else + + if (excludedAssemblyNames.Contains(assemblyName)) { Log.LogMessage(MessageImportance.Normal, "Skipping: {0}", assemblyPath); + continue; } - } - FilteredAssemblies = filtered.ToArray(); - return true; - } - /// - /// Returns true if the assembly at the given path should be included otherwise false - /// - private bool Include(string assemblyPath) - { - if (assemblyPath.IndexOf(m_netStandardPatttern, StringComparison.OrdinalIgnoreCase) > 0) - { - return false; - } - - string assemblyFileName = Path.GetFileName(assemblyPath); - string assemblyName = Path.GetFileNameWithoutExtension(assemblyPath); - - foreach (ITaskItem ignoredAssembly in IgnoredAssemblies) - { - if (IsMatch(assemblyFileName, assemblyName, ignoredAssembly.ItemSpec)) - { - return false; - } + filtered.Add(sourceAssembly); + Log.LogMessage(MessageImportance.Normal, "Added: {0}", assemblyPath); } + FilteredAssemblies = filtered.ToArray(); return true; } - private static bool IsMatch(string assemblyFileName, string assemblyName, string pattern) + private static string GetAssemblyName(ITaskItem taskItem) { - if (string.IsNullOrWhiteSpace(pattern)) - { - return false; - } + string assemblyPath = taskItem.ItemSpec; + string fileName = Path.GetFileName(assemblyPath); - if (pattern.IndexOfAny(new[] { '*', '?' }) >= 0) + // Only strip known assembly file extensions. Names like + // "Microsoft.CodeAnalysis.CSharp" are assembly identities, not file paths. + if (fileName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || + fileName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) { - return WildcardMatch(assemblyFileName, pattern) - || WildcardMatch(assemblyName, pattern); + return Path.GetFileNameWithoutExtension(fileName); } - if (Path.HasExtension(pattern)) - { - return string.Equals(assemblyFileName, pattern, StringComparison.OrdinalIgnoreCase); - } - - return string.Equals(assemblyName, pattern, StringComparison.OrdinalIgnoreCase); - } - - private static bool WildcardMatch(string value, string pattern) - { - string regexPattern = "^" - + Regex.Escape(pattern) - .Replace("\\*", ".*") - .Replace("\\?", ".") - + "$"; - - return Regex.IsMatch(value, regexPattern, RegexOptions.IgnoreCase); + return fileName; } } + } \ No newline at end of file diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj index bf3fc78..2207785 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj @@ -20,6 +20,15 @@ + + $(MSBuildThisFileDirectory)bin/$(Configuration)/$(TargetFramework)/MSBuild/ + + + + + build/ @@ -30,7 +39,7 @@ lib/netstandard2.0/SourceGenerator.Foundations.Windows.dll - + sgf/injector/ diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props index 120a966..98f2bfd 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props @@ -17,34 +17,35 @@ true true Information - false - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets index 82f6e81..e75a2c4 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets @@ -8,8 +8,9 @@ - + diff --git a/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.deps.json b/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.deps.json deleted file mode 100644 index 9790def..0000000 --- a/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.deps.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETStandard,Version=v2.0/", - "signature": "" - }, - "compilationOptions": {}, - "targets": { - ".NETStandard,Version=v2.0": {}, - ".NETStandard,Version=v2.0/": { - "SourceGenerator.Foundations.MSBuild/1.0.0": { - "dependencies": { - "Microsoft.Build.Utilities.Core": "17.8.3" - }, - "runtime": { - "SourceGenerator.Foundations.MSBuild.dll": {} - } - }, - "Microsoft.Build.Utilities.Core/17.8.3": { - "dependencies": { - "Microsoft.NET.StringTools": "17.8.3", - "Microsoft.Win32.Registry": "5.0.0", - "System.Collections.Immutable": "7.0.0", - "System.Configuration.ConfigurationManager": "7.0.0", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Security.Principal.Windows": "5.0.0", - "System.Text.Encoding.CodePages": "7.0.0" - } - }, - "Microsoft.NET.StringTools/17.8.3": { - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.NET.StringTools.dll": { - "assemblyVersion": "1.0.0.0", - "fileVersion": "17.8.3.51904" - } - } - }, - "Microsoft.Win32.Registry/5.0.0": { - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5", - "System.Security.AccessControl": "6.0.0", - "System.Security.Principal.Windows": "5.0.0" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.Win32.Registry.dll": { - "assemblyVersion": "5.0.0.0", - "fileVersion": "5.0.20.51904" - } - } - }, - "System.Buffers/4.5.1": { - "runtime": { - "lib/netstandard2.0/System.Buffers.dll": { - "assemblyVersion": "4.0.3.0", - "fileVersion": "4.6.28619.1" - } - } - }, - "System.Collections.Immutable/7.0.0": { - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Collections.Immutable.dll": { - "assemblyVersion": "7.0.0.0", - "fileVersion": "7.0.22.51805" - } - } - }, - "System.Configuration.ConfigurationManager/7.0.0": { - "dependencies": { - "System.Security.Cryptography.ProtectedData": "7.0.0", - "System.Security.Permissions": "7.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Configuration.ConfigurationManager.dll": { - "assemblyVersion": "7.0.0.0", - "fileVersion": "7.0.22.51805" - } - } - }, - "System.Memory/4.5.5": { - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Memory.dll": { - "assemblyVersion": "4.0.1.2", - "fileVersion": "4.6.31308.1" - } - } - }, - "System.Numerics.Vectors/4.4.0": { - "runtime": { - "lib/netstandard2.0/System.Numerics.Vectors.dll": { - "assemblyVersion": "4.1.3.0", - "fileVersion": "4.6.25519.3" - } - } - }, - "System.Runtime.CompilerServices.Unsafe/6.0.0": { - "runtime": { - "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { - "assemblyVersion": "6.0.0.0", - "fileVersion": "6.0.21.52210" - } - } - }, - "System.Security.AccessControl/6.0.0": { - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Security.AccessControl.dll": { - "assemblyVersion": "6.0.0.0", - "fileVersion": "6.0.21.52210" - } - } - }, - "System.Security.Cryptography.ProtectedData/7.0.0": { - "runtime": { - "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { - "assemblyVersion": "7.0.0.0", - "fileVersion": "7.0.22.51805" - } - } - }, - "System.Security.Permissions/7.0.0": { - "dependencies": { - "System.Security.AccessControl": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Security.Permissions.dll": { - "assemblyVersion": "7.0.0.0", - "fileVersion": "7.0.22.51805" - } - } - }, - "System.Security.Principal.Windows/5.0.0": { - "runtime": { - "lib/netstandard2.0/System.Security.Principal.Windows.dll": { - "assemblyVersion": "5.0.0.0", - "fileVersion": "5.0.20.51904" - } - } - }, - "System.Text.Encoding.CodePages/7.0.0": { - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": { - "assemblyVersion": "7.0.0.0", - "fileVersion": "7.0.22.51805" - } - } - } - } - }, - "libraries": { - "SourceGenerator.Foundations.MSBuild/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - }, - "Microsoft.Build.Utilities.Core/17.8.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ex8Sjx02q0FmForLRFItB82sJx5s2JRWIpJgYDW1g7xLUoFlKLoNp67UwS5xN8YcYBkT7vRxXeYx/dQ96KaWtg==", - "path": "microsoft.build.utilities.core/17.8.3", - "hashPath": "microsoft.build.utilities.core.17.8.3.nupkg.sha512" - }, - "Microsoft.NET.StringTools/17.8.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-y6DiuacjlIfXH3XVQG5htf+4oheinZAo7sHbITB3z7yCXQec48f9ZhGSXkr+xn1bfl73Yc3ZQEW2peJ5X68AvQ==", - "path": "microsoft.net.stringtools/17.8.3", - "hashPath": "microsoft.net.stringtools.17.8.3.nupkg.sha512" - }, - "Microsoft.Win32.Registry/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "path": "microsoft.win32.registry/5.0.0", - "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" - }, - "System.Buffers/4.5.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", - "path": "system.buffers/4.5.1", - "hashPath": "system.buffers.4.5.1.nupkg.sha512" - }, - "System.Collections.Immutable/7.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", - "path": "system.collections.immutable/7.0.0", - "hashPath": "system.collections.immutable.7.0.0.nupkg.sha512" - }, - "System.Configuration.ConfigurationManager/7.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-WvRUdlL1lB0dTRZSs5XcQOd5q9MYNk90GkbmRmiCvRHThWiojkpGqWdmEDJdXyHbxG/BhE5hmVbMfRLXW9FJVA==", - "path": "system.configuration.configurationmanager/7.0.0", - "hashPath": "system.configuration.configurationmanager.7.0.0.nupkg.sha512" - }, - "System.Memory/4.5.5": { - "type": "package", - "serviceable": true, - "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", - "path": "system.memory/4.5.5", - "hashPath": "system.memory.4.5.5.nupkg.sha512" - }, - "System.Numerics.Vectors/4.4.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==", - "path": "system.numerics.vectors/4.4.0", - "hashPath": "system.numerics.vectors.4.4.0.nupkg.sha512" - }, - "System.Runtime.CompilerServices.Unsafe/6.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==", - "path": "system.runtime.compilerservices.unsafe/6.0.0", - "hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512" - }, - "System.Security.AccessControl/6.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==", - "path": "system.security.accesscontrol/6.0.0", - "hashPath": "system.security.accesscontrol.6.0.0.nupkg.sha512" - }, - "System.Security.Cryptography.ProtectedData/7.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-xSPiLNlHT6wAHtugASbKAJwV5GVqQK351crnILAucUioFqqieDN79evO1rku1ckt/GfjIn+b17UaSskoY03JuA==", - "path": "system.security.cryptography.protecteddata/7.0.0", - "hashPath": "system.security.cryptography.protecteddata.7.0.0.nupkg.sha512" - }, - "System.Security.Permissions/7.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Vmp0iRmCEno9BWiskOW5pxJ3d9n+jUqKxvX4GhLwFhnQaySZmBN2FuC0N5gjFHgyFMUjC5sfIJ8KZfoJwkcMmA==", - "path": "system.security.permissions/7.0.0", - "hashPath": "system.security.permissions.7.0.0.nupkg.sha512" - }, - "System.Security.Principal.Windows/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", - "path": "system.security.principal.windows/5.0.0", - "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" - }, - "System.Text.Encoding.CodePages/7.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", - "path": "system.text.encoding.codepages/7.0.0", - "hashPath": "system.text.encoding.codepages.7.0.0.nupkg.sha512" - } - } -} \ No newline at end of file diff --git a/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.dll b/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.dll deleted file mode 100644 index cc82b87885a907edb951ab39526590a22a3175ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16896 zcmeHu2|Scv+whsyAp4qiP)xRLr6TJf*|(?^gR#^w(-ma-?@kW^*qn}Jn!>;@B99K-|zc*r4Zs^A?dW?cBM0UL@16{`ioW!@)BRVe!>O76iS;Y0?L9>k=C68$M*VRRPJk4j`l zgb_o+h-4=>VkkX;sx2VEw`kt9vlRgLC=6)yy;}aOwoaf-0M3vQj3gR0Y;6Q^i0Ote&KykVM z`#=Fr5(0ovee>KMEtLkHMJ<-ZoQ#7evFfYl`Ix^ap}&7hVNPPz70@v_3qQJDv|sf)#6!pcFrk^8QBo5tIoP81bS|cmG1@>~D+& zJBKe0rWRIROos<#K)X;?1Wkf<;}3*{!~Eof_7RF-a)Cww58=1~FI@t1#jqk+5^Oo2 zmK_>mFrawN#du!26l9@E(hy29m%&=4(qy^e5y9ruVcmQha=)Z@|ACYs<+Xsob09?T zFd9#nf$Aj0e<>s-#B?yg5#C`KMKI_X#AjJLw9O}}ia4h}fa$8@e$hz?dd4T;ubNk#Qj zi=`AzPtg^S>h#3WSS0RvEdpi^QI}H3k`$p#lNXJZB@rQ}j`@Wk{k0m}hW#zV41#UO zkd&YTb1Oud+aRFBgydsxN65Ip$OMRyRG@$ljh7-VLM%cX7H(@TQ1h9KjDtu6Z5?fW z9ev%Ekbt>OgOC98NF^SQXLy%}9jD^PVupkTg(DjKVKh_VUB$xdy4DvT{p%fPyaA5@( z_M#B!0Tl8q5ihsb71>X!0RvS1*8~%QLiDj^DhdK9r%kvygoHY5qhy5kUBe0 z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!cY3r~^;0y<|4eib5Em&!LzC~ zsL6tQbf_~|%CS-0|5f7#`ONuKsQ+lmovWh*Pp!`V82~?s0T2xT*B1)@?-Du)g=e6U zbFk5{MHEQElZ~*rK}iI(>knxgcp+zIk(043$cIOmq0fkX?)2<0zrrEk0X}H~B}j_` zpdALco?m{Ep_OoG6Y-bvH|_cFs!sy1oe@~v$(op zu#L1oBJtnjmo|(A4gMkL*wC;(dstTxwUSIl8X xhC{odP(p(}L4>0c$@Sk^^V<(3cm99*ACCYGGW@TtKv@5Oyr%zO!T*I3_+Jtv8=wFH diff --git a/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.pdb b/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.pdb deleted file mode 100644 index e298cb4d556336b1ed0a672019169c25c0a2a3f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10092 zcma)C2V4_L)Zai19Rv$@5iE!rAQXw{DG8wmFd(4l$tKxABn4Bzhy_JN5fwyF5l;{W zQ4moP70|Ps<-k*cv*20qR4jOUD4*xq_-2!x5Q=_Ze!t1??7aVbZ{Ezjd2etOb-SfZT2cf|TeX$b3+@3scC1l2|#o zMacS~;LqlSA%@^S2EX^63jH>cDM1h&dUV(q50r3 z5@}s%WMqh_wXy+q3MdAk^asTV6kJ=tMqL0)bsfLrba)$H;B#<`05$PP;CEPaLDs0- zaen5Y;Jo`0MFL1w0Pz%D{{`2VBogwO1UU5ZBOwY~5|RwcYEagLk_F0kPvUoy+~n(kmICcj3QG? zB$$kxB$dSv50ffoJj@pZ4^V|vM)i>@C45vNluG3Kav9I=JMC0<7(*!(@vVUoK<9`) z2{Cy%Dvzh~=MEzDrn%D?jUTVwxbxmDj@`fkal^W{#~ z^K-4iPL9-IR(KdupB#b7K*7QJZVbwe9hA^{b2Y784Q+8bi z12CulwDEbTfwLZ+4q5zSU#Qh$(IJ}>ow#>>l`$#3;mtSEhazvWKBxROWj&bp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cWKgy`er(84qncFvlM`)EKpa-0zb8Bb0!L8j!~_wNrDGA2p7GGG7im3S7xrq= zz7V8n^oCx(E5DReiFZCmM9=&~MiF=4@O4(C!ZW18JEX$5q{9D5dk2#Cj`9H?8!?>C z%n@Vq58zuVJ;Vx`1HL*UCmAA>^}yFt!;HblN7iIR1B9iAjKB%}4Dl-&(c{@u5c{$I zriiH?LI)ogMFpGnN6g5Ephi)t=?xG|a*&$qP{g+%;zLd%2ynQ{or0K}dyWMro4_?Q p)F7QGs-dJPvf%(^w4urn2`3vGA)yqNi9SLem}KUPFiipZ{{nc(6~6!g From bd139b8fe41bd0a95e5cb389192a27d667c5a3d0 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Wed, 1 Jul 2026 20:36:44 -0400 Subject: [PATCH 2/5] Ended up removing the MSBuild project because of developer pains If you wanted to build the project you had to keep killing msbuild which sucked. Moved it to an inline script and everything is better --- src/Directory.Build.props | 5 +- src/Directory.Packages.props | 4 +- .../FilterAssembliesTaskTests.cs | 173 ------------------ .../Shims/BuildEngineShim.cs | 21 --- ...Generator.Foundations.MSBuild.Tests.csproj | 25 --- .../FilterAssembliesTaskFactory.cs | 49 +++++ src/SourceGenerator.Foundations.sln | 4 +- .../Build/FilterAssembliesTask.targets | 118 ++++++++++++ .../SourceGenerator.Foundations.props | 168 ++++++++--------- .../SourceGenerator.Foundations.targets | 6 +- .../SourceGenerator.Foundations.csproj | 10 +- 11 files changed, 266 insertions(+), 317 deletions(-) delete mode 100644 src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs delete mode 100644 src/SourceGenerator.Foundations.MSBuild.Tests/Shims/BuildEngineShim.cs delete mode 100644 src/SourceGenerator.Foundations.MSBuild.Tests/SourceGenerator.Foundations.MSBuild.Tests.csproj create mode 100644 src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs create mode 100644 src/SourceGenerator.Foundations/Build/FilterAssembliesTask.targets rename src/SourceGenerator.Foundations/{ => Build}/SourceGenerator.Foundations.props (98%) rename src/SourceGenerator.Foundations/{ => Build}/SourceGenerator.Foundations.targets (96%) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c8badfd..02313b1 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -15,9 +15,10 @@ $(SGFSourceDir)SourceGenerator.Foundations\ $(SGFProjectDir)SourceGenerator.Foundations.csproj - $(SGFProjectDir)SourceGenerator.Foundations.targets - $(SGFProjectDir)SourceGenerator.Foundations.props + $(SGFProjectDir)Build\SourceGenerator.Foundations.targets + $(SGFProjectDir)Build\SourceGenerator.Foundations.props + $(SGFSourceDir)SourceGenerator.Foundations.Shared\ $(SGFSharedProjectDir)SourceGenerator.Foundations.Shared.projitems diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 93b17bb..44c8a66 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -6,8 +6,8 @@ - - + + diff --git a/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs b/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs deleted file mode 100644 index bd183cc..0000000 --- a/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs +++ /dev/null @@ -1,173 +0,0 @@ -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using SGF.Shims; - -namespace SourceGenerator.Foundations.MSBuild.Tests -{ - public class FilterAssembliesTaskTests - { - [Fact] - public void ExcludesCodeAnalysisAssembliesByDefaultPattern() - { - FilterAssembliesTask task = new FilterAssembliesTask - { - BuildEngine = new BuildEngineShim(), - ExcludedAssemblyNames = new TaskItem[] - { - new("Microsoft.CodeAnalysis*"), - }, - Assemblies = new TaskItem[] - { - new("/tmp/Microsoft.CodeAnalysis.dll"), - new("/tmp/Microsoft.CodeAnalysis.CSharp.dll"), - new("/tmp/Newtonsoft.Json.dll"), - } - }; - - bool result = task.Execute(); - - Assert.True(result); - Assert.Single(task.FilteredAssemblies); - Assert.Equal("/tmp/Newtonsoft.Json.dll", task.FilteredAssemblies[0].ItemSpec); - } - - [Fact] - public void ExcludesNamedAssemblyWithoutExtension() - { - FilterAssembliesTask task = new FilterAssembliesTask - { - BuildEngine = new BuildEngineShim(), - ExcludedAssemblyNames = new TaskItem[] - { - new("MyDependency"), - }, - Assemblies = new TaskItem[] - { - new("/tmp/MyDependency.dll"), - new("/tmp/OtherDependency.dll"), - } - }; - - bool result = task.Execute(); - - Assert.True(result); - Assert.Single(task.FilteredAssemblies); - Assert.Equal("/tmp/OtherDependency.dll", task.FilteredAssemblies[0].ItemSpec); - } - - [Fact] - public void IncludesAssembliesWhenNoIgnoredPatternMatches() - { - FilterAssembliesTask task = new FilterAssembliesTask - { - BuildEngine = new BuildEngineShim(), - ExcludedAssemblyNames = new TaskItem[] - { - new("Does.Not.Match*"), - }, - Assemblies = new TaskItem[] - { - new("/tmp/Microsoft.CodeAnalysis.dll"), - new("/tmp/Microsoft.CodeAnalysis.CSharp.dll"), - new("/tmp/MyDependency.dll"), - } - }; - - bool result = task.Execute(); - - Assert.True(result); - Assert.Equal(3, task.FilteredAssemblies.Length); - } - - [Fact] - public void ExcludesSpecificAssemblyFileName() - { - FilterAssembliesTask task = new FilterAssembliesTask - { - BuildEngine = new BuildEngineShim(), - ExcludedAssemblyNames = new TaskItem[] - { - new("System.Collections.Immutable.dll"), - }, - Assemblies = new TaskItem[] - { - new("/tmp/System.Collections.Immutable.dll"), - new("/tmp/MyLibrary.dll"), - } - }; - - bool result = task.Execute(); - - Assert.True(result); - Assert.Single(task.FilteredAssemblies); - Assert.Equal("/tmp/MyLibrary.dll", task.FilteredAssemblies[0].ItemSpec); - } - - [Fact] - public void ExcludesDottedAssemblyNameWithoutExtension() - { - FilterAssembliesTask task = new FilterAssembliesTask - { - BuildEngine = new BuildEngineShim(), - ExcludedAssemblyNames = new TaskItem[] - { - new("Microsoft.CodeAnalysis.CSharp"), - }, - Assemblies = new TaskItem[] - { - new("/tmp/Microsoft.CodeAnalysis.CSharp.dll"), - new("/tmp/MyLibrary.dll"), - } - }; - - bool result = task.Execute(); - - Assert.True(result); - Assert.Single(task.FilteredAssemblies); - Assert.Equal("/tmp/MyLibrary.dll", task.FilteredAssemblies[0].ItemSpec); - } - - [Fact] - public void ExcludesNetStandardLibraryAssemblies() - { - string separator = System.IO.Path.DirectorySeparatorChar.ToString(); - FilterAssembliesTask task = new FilterAssembliesTask - { - BuildEngine = new BuildEngineShim(), - Assemblies = new TaskItem[] - { - new($"{separator}packages{separator}netstandard.library{separator}2.0.3{separator}System.Data.dll"), - new($"{separator}packages{separator}netstandard.library{separator}2.0.3{separator}System.Xml.dll"), - new($"{separator}packages{separator}mypackage{separator}1.0.0{separator}MyLibrary.dll"), - } - }; - - bool result = task.Execute(); - - Assert.True(result); - Assert.Single(task.FilteredAssemblies); - Assert.Contains("MyLibrary.dll", task.FilteredAssemblies[0].ItemSpec); - } - - [Fact] - public void PreservesTaskItemMetadata() - { - TaskItem assembly = new TaskItem("/tmp/MyLibrary.dll"); - assembly.SetMetadata("HintPath", "/some/path"); - assembly.SetMetadata("Private", "True"); - - FilterAssembliesTask task = new FilterAssembliesTask - { - BuildEngine = new BuildEngineShim(), - Assemblies = new ITaskItem[] { assembly } - }; - - bool result = task.Execute(); - - Assert.True(result); - Assert.Single(task.FilteredAssemblies); - Assert.Equal("/some/path", task.FilteredAssemblies[0].GetMetadata("HintPath")); - Assert.Equal("True", task.FilteredAssemblies[0].GetMetadata("Private")); - } - } -} diff --git a/src/SourceGenerator.Foundations.MSBuild.Tests/Shims/BuildEngineShim.cs b/src/SourceGenerator.Foundations.MSBuild.Tests/Shims/BuildEngineShim.cs deleted file mode 100644 index 4bdff64..0000000 --- a/src/SourceGenerator.Foundations.MSBuild.Tests/Shims/BuildEngineShim.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.Build.Framework; - -namespace SGF.Shims -{ - internal class BuildEngineShim : IBuildEngine - { - public bool ContinueOnError => false; - public int LineNumberOfTaskNode => 0; - public int ColumnNumberOfTaskNode => 0; - public string ProjectFileOfTaskNode => string.Empty; - public bool BuildProjectFile(string projectFileName, string[] targetNames, System.Collections.IDictionary globalProperties, System.Collections.IDictionary targetOutputs) - { - return true; - } - - public void LogCustomEvent(CustomBuildEventArgs e) { } - public void LogErrorEvent(BuildErrorEventArgs e) { } - public void LogMessageEvent(BuildMessageEventArgs e) { } - public void LogWarningEvent(BuildWarningEventArgs e) { } - } -} diff --git a/src/SourceGenerator.Foundations.MSBuild.Tests/SourceGenerator.Foundations.MSBuild.Tests.csproj b/src/SourceGenerator.Foundations.MSBuild.Tests/SourceGenerator.Foundations.MSBuild.Tests.csproj deleted file mode 100644 index 29df2eb..0000000 --- a/src/SourceGenerator.Foundations.MSBuild.Tests/SourceGenerator.Foundations.MSBuild.Tests.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net10.0 - enable - enable - false - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs b/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs new file mode 100644 index 0000000..3b35611 --- /dev/null +++ b/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs @@ -0,0 +1,49 @@ +using Microsoft.Build.Framework; +using SourceGenerator.Foundations.MSBuild; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SGF +{ + public class FilterAssembliesTaskFactory : ITaskFactory + { + public string FactoryName { get; } = nameof(FilterAssembliesTaskFactory); + + public Type TaskType => typeof(FilterAssembliesTask); + + public void CleanupTask(ITask task) + { + if(task is IDisposable disposable) + { + disposable.Dispose(); + } + } + + public ITask CreateTask(IBuildEngine taskFactoryLoggingHost) + { + return (ITask)Activator.CreateInstance(TaskType)!; + + } + + public TaskPropertyInfo[] GetTaskParameters() + { + return TaskType + .GetProperties() + .Where(p => p.GetCustomAttributes(typeof(OutputAttribute), true).Any() + || p.CanWrite) + .Select(p => new TaskPropertyInfo( + p.Name, + p.PropertyType, + p.CanWrite, + p.GetCustomAttributes(typeof(OutputAttribute), true).Any())) + .ToArray(); + } + + public bool Initialize(string taskName, IDictionary parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost) + { + return true; + } + } +} diff --git a/src/SourceGenerator.Foundations.sln b/src/SourceGenerator.Foundations.sln index d4b2b16..729e2f8 100644 --- a/src/SourceGenerator.Foundations.sln +++ b/src/SourceGenerator.Foundations.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.31911.260 +# Visual Studio Version 18 +VisualStudioVersion = 18.6.11828.311 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGenerator.Foundations", "SourceGenerator.Foundations\SourceGenerator.Foundations.csproj", "{0085A518-02B6-4218-B718-00C0F69B99AB}" EndProject diff --git a/src/SourceGenerator.Foundations/Build/FilterAssembliesTask.targets b/src/SourceGenerator.Foundations/Build/FilterAssembliesTask.targets new file mode 100644 index 0000000..a51b88e --- /dev/null +++ b/src/SourceGenerator.Foundations/Build/FilterAssembliesTask.targets @@ -0,0 +1,118 @@ + + + + + + + + + + + + /// The list of assemblies that we can filter out + /// + [Required] + public ITaskItem[] Assemblies { get; set; } + + /// + /// Gets the list of assemblies that have been excluded from the list. + /// This is used to filter out assemblies that should not be embedded. This are based on the assembly name + /// not the full path + /// + [Required] + public ITaskItem[] ExcludedAssemblyNames { get; set; } + + /// + /// The filtered version of + /// + [Output] + public ITaskItem[] FilteredAssemblies { get; set; } + + public FilterAssembliesTask() + { + Assemblies = Array.Empty(); + ExcludedAssemblyNames = Array.Empty(); + FilteredAssemblies = Array.Empty(); + m_netStandardPattern = $"{Path.DirectorySeparatorChar}netstandard.library{Path.DirectorySeparatorChar}"; + } + + /// + public override bool Execute() + { + List filtered = new List(Assemblies.Length); + + HashSet excludedAssemblyNames = new HashSet(ExcludedAssemblyNames + .Select(GetAssemblyName), + StringComparer.OrdinalIgnoreCase); + + + foreach (ITaskItem sourceAssembly in Assemblies) + { + string assemblyPath = sourceAssembly.ItemSpec; + string assemblyName = GetAssemblyName(sourceAssembly); + + if (string.IsNullOrWhiteSpace(assemblyPath)) + { + continue; + } + + if (assemblyPath.IndexOf(m_netStandardPattern, StringComparison.OrdinalIgnoreCase) > 0) + { + // Skipping netstandard.library assemblies as they are part of the .NET Standard framework and should not be embedded. + continue; + } + + if (excludedAssemblyNames.Contains(assemblyName)) + { + Log.LogMessage(MessageImportance.Normal, "Skipping: {0}", assemblyPath); + continue; + } + + filtered.Add(sourceAssembly); + Log.LogMessage(MessageImportance.Normal, "Added: {0}", assemblyPath); + } + FilteredAssemblies = filtered.ToArray(); + return true; + } + + private static string GetAssemblyName(ITaskItem taskItem) + { + string assemblyPath = taskItem.ItemSpec; + string fileName = Path.GetFileName(assemblyPath); + + // Only strip known assembly file extensions. Names like + // "Microsoft.CodeAnalysis.CSharp" are assembly identities, not file paths. + if (fileName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || + fileName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) + { + return Path.GetFileNameWithoutExtension(fileName); + } + + return fileName; + } + } + ]]> + + + + \ No newline at end of file diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props similarity index 98% rename from src/SourceGenerator.Foundations/SourceGenerator.Foundations.props rename to src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props index 98f2bfd..38cd2ac 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props +++ b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props @@ -1,84 +1,84 @@ - - - - - false - true - false - true - $(MSBuildThisFileDirectory)SourceGenerator.Foundations.MSBuild.dll - $(MSBuildThisFileDirectory)SourceGenerator.Foundations.Injector.exe - true - true - true - Information - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SGF/%(RecursiveDir)%(Filename)%(Extension) - - - - SGF/Polyfills/Nullable/%(RecursiveDir)%(Filename)%(Extension) - - - - SGF/Polyfills/InitProperties/%(RecursiveDir)%(Filename)%(Extension) - - - - SGF/Polyfills/RequiredMembers/%(RecursiveDir)%(Filename)%(Extension) - - - + + + + + false + true + false + true + $(MSBuildThisFileDirectory)SourceGenerator.Foundations.MSBuild.dll + $(MSBuildThisFileDirectory)SourceGenerator.Foundations.Injector.exe + true + true + true + Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SGF/%(RecursiveDir)%(Filename)%(Extension) + + + + SGF/Polyfills/Nullable/%(RecursiveDir)%(Filename)%(Extension) + + + + SGF/Polyfills/InitProperties/%(RecursiveDir)%(Filename)%(Extension) + + + + SGF/Polyfills/RequiredMembers/%(RecursiveDir)%(Filename)%(Extension) + + + diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.targets similarity index 96% rename from src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets rename to src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.targets index e75a2c4..4a2cb02 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets +++ b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.targets @@ -6,9 +6,9 @@ won't exist. ==================================================--> - + - @@ -63,5 +63,5 @@ Condition="!$(IsNamedVersion) AND $([MSBuild]::VersionGreaterThan('$(MinLangVersion)', '$(LangVersion)'))" Text="[SourceGenerator.Foundations] The project $(MSBuildProjectName) is currently using the language version $(LangVersion) which does not meet the minimum required of $(MinLangVersion). Read how to change it here https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version" /> - + \ No newline at end of file diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj index 2207785..c0f70d2 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj @@ -11,13 +11,12 @@ - - + @@ -25,9 +24,7 @@ - + @@ -39,6 +36,9 @@ lib/netstandard2.0/SourceGenerator.Foundations.Windows.dll + + Build/ + sgf/injector/ From 8bf90caca23a85ebf76c68ec7e69e5b3cadf5851 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Wed, 1 Jul 2026 21:02:20 -0400 Subject: [PATCH 3/5] Removed the reaming references to msbuild --- .github/workflows/ci.yml | 2 - src/SourceGenerator.Foundations.MSBuild.slnx | 4 - .../FilterAssembliesTask.cs | 106 ------------------ .../FilterAssembliesTaskFactory.cs | 49 -------- .../PublishProfiles/FolderProfile.pubxml | 14 --- .../PublishProfiles/FolderProfile.pubxml.user | 10 -- ...SourceGenerator.Foundations.MSBuild.csproj | 9 -- ...eGenerator.Foundations.MSBuild.csproj.user | 6 - 8 files changed, 200 deletions(-) delete mode 100644 src/SourceGenerator.Foundations.MSBuild.slnx delete mode 100644 src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs delete mode 100644 src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs delete mode 100644 src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml delete mode 100644 src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml.user delete mode 100644 src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj delete mode 100644 src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj.user diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec3ed63..2a8a220 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ env: ProjectDir: src\SourceGenerator.Foundations\ ProjectName: SourceGenerator.Foundations.csproj SolutionPath: src\SourceGenerator.Foundations.sln - MSBUILDDISABLENODEREUSE: '1' # Stops MSBuild from locking MSBuild nuget package jobs: build: name: Build | All @@ -36,7 +35,6 @@ jobs: - name: SourceGenerator.Foundations.Tests - name: ConsoleApp.SourceGenerator.Tests path: Sandbox/ - - name: SourceGenerator.Foundations.MSBuild.Tests steps: - uses: actions/checkout@v3 with: diff --git a/src/SourceGenerator.Foundations.MSBuild.slnx b/src/SourceGenerator.Foundations.MSBuild.slnx deleted file mode 100644 index fe1736f..0000000 --- a/src/SourceGenerator.Foundations.MSBuild.slnx +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs b/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs deleted file mode 100644 index c9230f0..0000000 --- a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs +++ /dev/null @@ -1,106 +0,0 @@ -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text.RegularExpressions; - -namespace SourceGenerator.Foundations.MSBuild -{ - /// - /// When choose which assemblies to be embedded we need to filter out quite a few - /// to avoid them be embedded. For example any of the defalut ones in the GAC 'mscorlib', reference only - /// assemblies 'Microsoft.CSharp'. We have to analizes these inside a custom task because some of this - /// information is only accessable from within C# code. - /// - public class FilterAssembliesTask : Task, ITask - { - private readonly string m_netStandardPattern; - - /// - /// The list of assemblies that we can filter out - /// - [Required] - public ITaskItem[] Assemblies { get; set; } - - /// - /// Gets the list of assemblies that have been excluded from the list. - /// This is used to filter out assemblies that should not be embedded. This are based on the assembly name - /// not the full path - /// - [Required] - public ITaskItem[] ExcludedAssemblyNames { get; set; } - - /// - /// The filtered version of - /// - [Output] - public ITaskItem[] FilteredAssemblies { get; set; } - - public FilterAssembliesTask() - { - Assemblies = Array.Empty(); - ExcludedAssemblyNames = Array.Empty(); - FilteredAssemblies = Array.Empty(); - m_netStandardPattern = $"{Path.DirectorySeparatorChar}netstandard.library{Path.DirectorySeparatorChar}"; - } - - /// - public override bool Execute() - { - List filtered = new List(Assemblies.Length); - - HashSet excludedAssemblyNames = new HashSet(ExcludedAssemblyNames - .Select(GetAssemblyName), - StringComparer.OrdinalIgnoreCase); - - - foreach (ITaskItem sourceAssembly in Assemblies) - { - string assemblyPath = sourceAssembly.ItemSpec; - string assemblyName = GetAssemblyName(sourceAssembly); - - if (string.IsNullOrWhiteSpace(assemblyPath)) - { - continue; - } - - if (assemblyPath.IndexOf(m_netStandardPattern, StringComparison.OrdinalIgnoreCase) > 0) - { - // Skipping netstandard.library assemblies as they are part of the .NET Standard framework and should not be embedded. - continue; - } - - if (excludedAssemblyNames.Contains(assemblyName)) - { - Log.LogMessage(MessageImportance.Normal, "Skipping: {0}", assemblyPath); - continue; - } - - filtered.Add(sourceAssembly); - Log.LogMessage(MessageImportance.Normal, "Added: {0}", assemblyPath); - } - FilteredAssemblies = filtered.ToArray(); - return true; - } - - private static string GetAssemblyName(ITaskItem taskItem) - { - string assemblyPath = taskItem.ItemSpec; - string fileName = Path.GetFileName(assemblyPath); - - // Only strip known assembly file extensions. Names like - // "Microsoft.CodeAnalysis.CSharp" are assembly identities, not file paths. - if (fileName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || - fileName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) - { - return Path.GetFileNameWithoutExtension(fileName); - } - - return fileName; - } - } - -} \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs b/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs deleted file mode 100644 index 3b35611..0000000 --- a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTaskFactory.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Build.Framework; -using SourceGenerator.Foundations.MSBuild; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace SGF -{ - public class FilterAssembliesTaskFactory : ITaskFactory - { - public string FactoryName { get; } = nameof(FilterAssembliesTaskFactory); - - public Type TaskType => typeof(FilterAssembliesTask); - - public void CleanupTask(ITask task) - { - if(task is IDisposable disposable) - { - disposable.Dispose(); - } - } - - public ITask CreateTask(IBuildEngine taskFactoryLoggingHost) - { - return (ITask)Activator.CreateInstance(TaskType)!; - - } - - public TaskPropertyInfo[] GetTaskParameters() - { - return TaskType - .GetProperties() - .Where(p => p.GetCustomAttributes(typeof(OutputAttribute), true).Any() - || p.CanWrite) - .Select(p => new TaskPropertyInfo( - p.Name, - p.PropertyType, - p.CanWrite, - p.GetCustomAttributes(typeof(OutputAttribute), true).Any())) - .ToArray(); - } - - public bool Initialize(string taskName, IDictionary parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost) - { - return true; - } - } -} diff --git a/src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml b/src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml deleted file mode 100644 index 0dc71c7..0000000 --- a/src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Release - Any CPU - D:\Repositories\SourceGenerator.Foudations\src\libs\SourceGenerator.Foundations.MSBuild - FileSystem - <_TargetId>Folder - netstandard2.0 - - \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml.user b/src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml.user deleted file mode 100644 index 283b477..0000000 --- a/src/SourceGenerator.Foundations.MSBuild/Properties/PublishProfiles/FolderProfile.pubxml.user +++ /dev/null @@ -1,10 +0,0 @@ - - - - - True|2024-07-27T22:11:15.7425499Z||; - - - \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj b/src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj deleted file mode 100644 index 3cac89e..0000000 --- a/src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - netstandard2.0 - - - - - - diff --git a/src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj.user b/src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj.user deleted file mode 100644 index 981437f..0000000 --- a/src/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.csproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - <_LastSelectedProfileId>D:\Repositories\SourceGenerator.Foudations\src\SourceGenerator.Foundations.MSBuild\Properties\PublishProfiles\FolderProfile.pubxml - - \ No newline at end of file From 277dfb02a0111d7e4c4c6e578dbd16bda3cfa00c Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Wed, 1 Jul 2026 21:51:01 -0400 Subject: [PATCH 4/5] Removed MSBuild references --- .../SourceGenerator.Foundations.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj index c0f70d2..4f232e6 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj @@ -22,10 +22,6 @@ $(MSBuildThisFileDirectory)bin/$(Configuration)/$(TargetFramework)/MSBuild/ - - - - build/ From e24c162629fc23cfaad053dec7bfbfa4db8dd08a Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Sun, 5 Jul 2026 20:52:01 -0400 Subject: [PATCH 5/5] Removed all references to msbuild --- src/Directory.Build.props | 4 ---- .../Build/SourceGenerator.Foundations.props | 1 - .../SourceGenerator.Foundations.csproj | 3 --- 3 files changed, 8 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 02313b1..d66d22e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -24,14 +24,10 @@ $(SGFSourceDir)SourceGenerator.Foundations.Contracts\ $(SGFContractsProjectDir)SourceGenerator.Foundations.Contracts.csproj - - $(SGFSourceDir)SourceGenerator.Foundations.MSBuild\ - $(SGFMSBuildProjectDir)SourceGenerator.Foundations.MSBuild.csproj $(SGFSourceDir)Plugins\SourceGenerator.Foundations.Windows\ $(SGFWindowsPluginProjectDir)SourceGenerator.Foundations.Windows.csproj - $(SGFSourceDir)SourceGenerator.Foundations.MSBuild\bin\$(Configuration)\netstandard2.0\SourceGenerator.Foundations.MSBuild.dll diff --git a/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props index 38cd2ac..89cc7df 100644 --- a/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props +++ b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props @@ -11,7 +11,6 @@ true false true - $(MSBuildThisFileDirectory)SourceGenerator.Foundations.MSBuild.dll $(MSBuildThisFileDirectory)SourceGenerator.Foundations.Injector.exe true true diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj index 4f232e6..80dab22 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj @@ -23,9 +23,6 @@ $(MSBuildThisFileDirectory)bin/$(Configuration)/$(TargetFramework)/MSBuild/ - - build/ - lib/netstandard2.0/SourceGenerator.Foundations.Contracts.dll