From b9a5807b55633ca234426865b61ee06a31a68d75 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 3 Apr 2022 17:19:10 +0200 Subject: [PATCH] Minor tweaks, fix Core analyzer references --- .../ComputeSharp.Benchmark.csproj | 7 ++- .../ComputeSharp.ImageProcessing.csproj | 7 ++- .../ComputeSharp.Sample.FSharp.Shaders.csproj | 7 ++- .../ComputeSharp.Sample.FSharp.fsproj | 7 ++- .../ComputeSharp.Sample.csproj | 7 ++- .../ComputeSharp.SwapChain.Uwp.csproj | 1 + .../ComputeSharp.SwapChain.WinUI.csproj | 6 +-- .../ComputeSharp.SwapChain.csproj | 7 ++- .../AutoConstructorGenerator.cs | 2 +- .../GlobalUsingDirectivesGenerator.cs | 4 +- .../ComputeSharp.Core.csproj | 7 +++ .../ComputeSharp.Core.targets | 53 +++++++++++++++++++ ...arp.Tests.DisableDynamicCompilation.csproj | 7 ++- .../ComputeSharp.Tests.Internals.csproj | 7 ++- .../AutoConstructorGeneratorTests.cs | 2 +- ...ComputeSharp.Tests.SourceGenerators.csproj | 1 + .../ComputeSharp.Tests.csproj | 13 ++--- 17 files changed, 97 insertions(+), 48 deletions(-) create mode 100644 src/ComputeSharp.Core/ComputeSharp.Core.targets diff --git a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj index 1ea30a7a..002e1078 100644 --- a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj +++ b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj @@ -23,12 +23,11 @@ + + - + \ No newline at end of file diff --git a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj index 779450a0..59564f49 100644 --- a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj +++ b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj @@ -15,12 +15,11 @@ + + - + diff --git a/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj b/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj index 33165757..6ccc804e 100644 --- a/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj +++ b/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj @@ -5,12 +5,11 @@ + + - + diff --git a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj b/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj index 0c746598..f559a565 100644 --- a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj +++ b/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj @@ -15,12 +15,11 @@ + + - + diff --git a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj b/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj index 138428ab..b1c021b0 100644 --- a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj +++ b/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj @@ -7,12 +7,11 @@ + + - + diff --git a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj index 13f43bbd..a5be5595 100644 --- a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj +++ b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj @@ -231,6 +231,7 @@ + diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj index f4dc10e2..f62c81b7 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj +++ b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj @@ -40,11 +40,9 @@ + - + diff --git a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj index 7220b8f9..d6fcfddc 100644 --- a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj +++ b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj @@ -8,11 +8,10 @@ + + - + diff --git a/src/ComputeSharp.Core.SourceGenerators/AutoConstructorGenerator.cs b/src/ComputeSharp.Core.SourceGenerators/AutoConstructorGenerator.cs index dc38178b..448bedfb 100644 --- a/src/ComputeSharp.Core.SourceGenerators/AutoConstructorGenerator.cs +++ b/src/ComputeSharp.Core.SourceGenerators/AutoConstructorGenerator.cs @@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators; +namespace ComputeSharp.Core.SourceGenerators; /// /// A source generator creating constructors for types annotated with . diff --git a/src/ComputeSharp.Core.SourceGenerators/GlobalUsingDirectivesGenerator.cs b/src/ComputeSharp.Core.SourceGenerators/GlobalUsingDirectivesGenerator.cs index 30d8933d..8fb5b86b 100644 --- a/src/ComputeSharp.Core.SourceGenerators/GlobalUsingDirectivesGenerator.cs +++ b/src/ComputeSharp.Core.SourceGenerators/GlobalUsingDirectivesGenerator.cs @@ -2,7 +2,7 @@ using System.Reflection; using Microsoft.CodeAnalysis; -namespace ComputeSharp.SourceGenerators; +namespace ComputeSharp.Core.SourceGenerators; /// /// A source generator to create global using directives for the HLSL primitive types. @@ -15,7 +15,7 @@ public sealed class GlobalUsingDirectivesGenerator : IIncrementalGenerator { context.RegisterPostInitializationOutput(static context => { - const string filename = "ComputeSharp.SourceGenerators.EmbeddedResources.GlobalUsingDirectives.cs"; + const string filename = "ComputeSharp.Core.SourceGenerators.EmbeddedResources.GlobalUsingDirectives.cs"; using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename); using StreamReader reader = new(stream); diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj index dd367caf..1ead8b6a 100644 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -219,4 +219,11 @@ + + + + + + + diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.targets b/src/ComputeSharp.Core/ComputeSharp.Core.targets new file mode 100644 index 00000000..79dfea91 --- /dev/null +++ b/src/ComputeSharp.Core/ComputeSharp.Core.targets @@ -0,0 +1,53 @@ + + + + + + <_ComputeSharpAnalyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'ComputeSharp.Core'" /> + + + + + + + + + + + + + + + @(CurrentCompilerAssemblyIdentity->'%(Version)') + + + true + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj b/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj index 7e8c771b..58e1ee6b 100644 --- a/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj +++ b/tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj @@ -15,11 +15,10 @@ + + - + - - + +