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/README.md b/README.md
index bf89fa7..2aa406d 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..d66d22e 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -15,23 +15,19 @@
$(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
$(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
-
- $(LibsDir)SourceGenerator.Foundations.MSBuild\SourceGenerator.Foundations.MSBuild.dll
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/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
deleted file mode 100644
index 87b3f26..0000000
--- a/src/SourceGenerator.Foundations.MSBuild.Tests/FilterAssembliesTaskTests.cs
+++ /dev/null
@@ -1,149 +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(),
- IgnoredAssemblies = 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(),
- IgnoredAssemblies = 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(),
- IgnoredAssemblies = 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(),
- IgnoredAssemblies = 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 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.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 273c0f5..0000000
--- a/src/SourceGenerator.Foundations.MSBuild/FilterAssembliesTask.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-using System;
-using System.Collections.Generic;
-using System.IO;
-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_netStandardPatttern;
-
- ///
- /// The list of assemblies that we can filter out
- ///
- [Required]
- public ITaskItem[] Assemblies { get; set; }
-
- ///
- /// Assembly names or wildcard patterns that should not be embedded.
- ///
- public ITaskItem[] IgnoredAssemblies { get; set; }
-
- ///
- /// The filtered version of
- ///
- [Output]
- public ITaskItem[] FilteredAssemblies { get; set; }
-
- public FilterAssembliesTask()
- {
- Assemblies = Array.Empty();
- IgnoredAssemblies = Array.Empty();
- FilteredAssemblies = Array.Empty();
-
- m_netStandardPatttern = $"{Path.DirectorySeparatorChar}netstandard.library{Path.DirectorySeparatorChar}";
- }
-
- ///
- public override bool Execute()
- {
- List filtered = new List(Assemblies.Length);
-
- foreach (ITaskItem assembly in Assemblies)
- {
- string assemblyPath = assembly.ItemSpec;
- if (string.IsNullOrWhiteSpace(assemblyPath))
- {
- continue;
- }
-
- if (Include(assemblyPath))
- {
- filtered.Add(assembly);
- Log.LogMessage(MessageImportance.Normal, "Added: {0}", assemblyPath);
- }
- else
- {
- Log.LogMessage(MessageImportance.Normal, "Skipping: {0}", assemblyPath);
- }
- }
- 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;
- }
- }
- return true;
- }
-
- private static bool IsMatch(string assemblyFileName, string assemblyName, string pattern)
- {
- if (string.IsNullOrWhiteSpace(pattern))
- {
- return false;
- }
-
- if (pattern.IndexOfAny(new[] { '*', '?' }) >= 0)
- {
- return WildcardMatch(assemblyFileName, pattern)
- || WildcardMatch(assemblyName, pattern);
- }
-
- 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);
- }
- }
-}
\ No newline at end of file
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
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 58%
rename from src/SourceGenerator.Foundations/SourceGenerator.Foundations.props
rename to src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props
index 120a966..89cc7df 100644
--- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.props
+++ b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.props
@@ -1,83 +1,83 @@
-
-
-
-
- false
- true
- false
- true
- $(MSBuildThisFileDirectory)SourceGenerator.Foundations.MSBuild.dll
- $(MSBuildThisFileDirectory)SourceGenerator.Foundations.Injector.exe
- true
- true
- true
- Information
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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.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 91%
rename from src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets
rename to src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.targets
index 82f6e81..4a2cb02 100644
--- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.targets
+++ b/src/SourceGenerator.Foundations/Build/SourceGenerator.Foundations.targets
@@ -6,10 +6,11 @@
won't exist.
==================================================-->
-
+
-
+
@@ -62,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 bf3fc78..80dab22 100644
--- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj
+++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj
@@ -11,26 +11,28 @@
-
-
+
+
+ $(MSBuildThisFileDirectory)bin/$(Configuration)/$(TargetFramework)/MSBuild/
+
-
- build/
-
lib/netstandard2.0/SourceGenerator.Foundations.Contracts.dll
lib/netstandard2.0/SourceGenerator.Foundations.Windows.dll
-
+
+ Build/
+
+
sgf/injector/
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 cc82b87..0000000
Binary files a/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.dll and /dev/null differ
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 e298cb4..0000000
Binary files a/src/libs/SourceGenerator.Foundations.MSBuild/SourceGenerator.Foundations.MSBuild.pdb and /dev/null differ