Skip to content

Commit

Permalink
Testing new action for msbuild (#1017)
Browse files Browse the repository at this point in the history
* update doc

* get those two passing

* it seems that this is needed
  • Loading branch information
belav authored Nov 16, 2023
1 parent e4434be commit 90bfc5b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
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

0 comments on commit 90bfc5b

Please sign in to comment.