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

Testing new action for msbuild #1017

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 4 additions & 10 deletions Src/CSharpier.MsBuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ One way to test the changes in the build/* files
- 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
Import-Module (RepoRoot)/Shell/Init.ps1
CSH-BuildPackages
```
- change the version in CSharpier.MSBuild.Test.csproj (until we update to 0.25.0 or higher), then it can be $(Version)
- Running this from the root `docker build . -f ./Src/CSharpier.MsBuild.Test/Dockerfile`

Another way
- the validate PR GH action does this, currently only uses the net8 sdk
- dotnet pack Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj -o nupkg /p:Version=0.0.1
- docker build -f ./Tests/CSharpier.MsBuild.Test/Dockerfile .
2 changes: 1 addition & 1 deletion Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- getting this to run a single time for projects that target multiple frameworks requires all of this
see https://github.com/dotnet/msbuild/issues/2781 -->
<Target Name="CSharpierFormat" BeforeTargets="DispatchToInnerBuilds;BeforeBuild">
<MSBuild Projects="$(MSBuildProjectFile)" Targets="CSharpierFormatInner" Properties="TargetFramework=$(FirstTargetFramework)" />
<MSBuild Projects="$(MSBuildProjectFile)" Targets="CSharpierFormatInner" Properties="TargetFramework=$(FirstTargetFramework);CSharpier_FrameworkVersion=$(CSharpier_FrameworkVersion)" />
</Target>

<Target Name="CSharpierLogBypass" BeforeTargets="CSharpierFormatInner" Condition="'$(CSharpier_Bypass)' == 'true'">
Expand Down
1 change: 1 addition & 0 deletions Tests/CSharpier.MsBuild.Test/net48/net48.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<OutputType>library</OutputType>
<TargetFramework>net48</TargetFramework>
<CSharpier_FrameworkVersion>net8.0</CSharpier_FrameworkVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Tests/CSharpier.MsBuild.Test/net7.0/net7.0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<OutputType>library</OutputType>
<TargetFramework>net7.0</TargetFramework>
<CSharpier_FrameworkVersion>net8.0</CSharpier_FrameworkVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading