Skip to content

Commit

Permalink
Conditionally import shared project in build process
Browse files Browse the repository at this point in the history
Added a condition to skip importing the shared project in `Plugin-Shared.shproj` if `SkipSharedProject` is true. Updated the GitHub Actions workflow to set this property when building the solution.
  • Loading branch information
ivandrofly committed Nov 20, 2024
1 parent 0070afa commit a6f81c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

# Build the solution
- name: Build solution
run: msbuild "source\Plugins.sln" /p:Configuration=Release /p:BuildProjectReferences=false
run: msbuild "source\Plugins.sln" /p:Configuration=Release /p:SkipSharedProject=true

# Run tests (optional)
#- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion source/Plugin-Shared/Plugin-Shared.shproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Plugin-Shared.projitems" Label="Shared" />
<Import Project="Plugin-Shared.projitems" Label="Shared" Condition="'$(SkipSharedProject)' != 'true'"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>

1 comment on commit a6f81c0

@ivandrofly
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration doesn't seems to be picked up be github workflow msbuild

Please sign in to comment.