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

Add DevelopmentDependency property to CSharpier.MsBuild.csproj #607

Merged
merged 2 commits into from Feb 14, 2022

Conversation

martinothamar
Copy link
Contributor

Hi, awesome project, thanks for your work!

This package only runs in BeforeTargets="Build" right? I just tested installing the MsBuild package like this (with PrivateAssets attr), in a global Directory.Build.Props file, and it seems to work:

  <ItemGroup>
    <PackageReference Include="CSharpier.MsBuild" Version="0.15.0" PrivateAssets="all" /> 
  </ItemGroup>

Usecase being we have some packages that are going to be published, and we only need csharpier during build (doesnt need to be a dep of the package).

Hi, awesome project, thanks for your work!

This package only runs in `BeforeTargets="Build"` right? I just tested installing the MsBuild package like this (with PrivateAssets attr), in a global `Directory.Build.Props` file, and it seems to work:
```csproj
  <ItemGroup>
    <PackageReference Include="CSharpier.MsBuild" Version="0.15.0" PrivateAssets="all" /> 
  </ItemGroup>
```

Usecase being we have some packages that are going to be published, and we only need `csharpier` during build (doesnt need to be a dep of the package).
@martinothamar
Copy link
Contributor Author

Btw, this should also add the PrivateAssets attribute to the package ref when users install via nuget.org or CLI, currently it installs as a normal dependency
image

@belav
Copy link
Owner

belav commented Feb 14, 2022

Thanks for reporting this.

I did find that when CSharpier.MsBuild is a DevelopmentDependency, it ends up in the csproj like this

      <PackageReference Include="CSharpier.MsBuild" Version="0.15.1">
        <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        <PrivateAssets>all</PrivateAssets>
      </PackageReference>

StyleCop.Analyzerz does the same thing.

@belav belav merged commit a5596b3 into belav:master Feb 14, 2022
Copy link
Collaborator

@shocklateboy92 shocklateboy92 left a comment

Choose a reason for hiding this comment

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

Woah... @belav beat me to a review 😮 Australia time-zone is having some disadvantages.
Thanks for your contribution @martinothamar !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants