From b48539ac74fd13893754f3058e4c22eea148b614 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Sun, 10 Sep 2023 14:52:12 -0500 Subject: [PATCH] Ensure that compilation errors surface properly when building a project with CSharpier.msbuild in debug closes #957 --- .gitignore | 1 + .../CSharpier.MsBuild.Test.sln | 16 ++++++++++++++++ Src/CSharpier.MsBuild/README.md | 8 +++++++- .../build/CSharpier.MsBuild.targets | 3 ++- 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln diff --git a/.gitignore b/.gitignore index dcbb4722e..5b17a04f9 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,4 @@ Src/CSharpier.VSCode/.idea/prettier.xml .idea/.idea.CSharpier/.idea/riderMarkupCache.xml /Src/CSharpier.Benchmarks/BenchmarkDotNet.Artifacts/ /Src/CSharpier.Tests/TestResults +/Src/CSharpier.MsBuild.Test/.idea diff --git a/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln b/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln new file mode 100644 index 000000000..069fac837 --- /dev/null +++ b/Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpier.MsBuild.Test", "CSharpier.MsBuild.Test.csproj", "{68C08C66-BB6C-4961-9298-7936549C4F20}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68C08C66-BB6C-4961-9298-7936549C4F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68C08C66-BB6C-4961-9298-7936549C4F20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68C08C66-BB6C-4961-9298-7936549C4F20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68C08C66-BB6C-4961-9298-7936549C4F20}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Src/CSharpier.MsBuild/README.md b/Src/CSharpier.MsBuild/README.md index ae658ef91..8c9de1d91 100644 --- a/Src/CSharpier.MsBuild/README.md +++ b/Src/CSharpier.MsBuild/README.md @@ -1,4 +1,10 @@ -This can be tested by +One way to test the changes in the build/* files +- Load CSharpier.MsBuild.csproj in your IDE +- Restore the nuget packages +- Edit those files at `C:\Users\[Username]\.nuget\packages\csharpier.msbuild\[VersionNumber]\build` +- Ensure you revert those files and make the same changes to the files here. + +Another way to test - Making any changes you want ```powershell diff --git a/Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets b/Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets index efb7b263a..5ecc745e3 100644 --- a/Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets +++ b/Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets @@ -10,11 +10,12 @@ + + Command="dotnet "$(CSharpierDllPath)" $(CSharpierArgs) --no-msbuild-check "$(MSBuildProjectDirectory)" > NUL" />