Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that compilation errors surface properly when building a project with CSharpier.msbuild in debug #959

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions Src/CSharpier.MsBuild.Test/CSharpier.MsBuild.Test.sln
Original file line number Diff line number Diff line change
@@ -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
8 changes: 7 additions & 1 deletion Src/CSharpier.MsBuild/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
</PropertyGroup>

<Target Name="CSharpierFormatInner" Condition="'$(CSharpier_Bypass)' != 'true'">
<!-- &gt; Null suppresses the output from this so that compilation errors -->
<Exec
ConsoleToMSBuild="true"
StdOutEncoding="utf-8"
StdErrEncoding="utf-8"
Command="dotnet &quot;$(CSharpierDllPath)&quot; $(CSharpierArgs) --no-msbuild-check &quot;$(MSBuildProjectDirectory)&quot;" />
Command="dotnet &quot;$(CSharpierDllPath)&quot; $(CSharpierArgs) --no-msbuild-check &quot;$(MSBuildProjectDirectory)&quot; &gt; NUL" />
shocklateboy92 marked this conversation as resolved.
Show resolved Hide resolved
</Target>

<!-- getting this to run a single time for projects that target multiple frameworks requires all of this
Expand Down