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

feat: Enable DotnetToolMode option when creating nupkg #9115

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Aug 22, 2023

What's included in this PR

  • Add MSBuild target to move templates folders to TargetFramework independent path.
  • Add MSBuild target to enable DotnetToolMode when creating nupkg with dotnet pack command.
  • Fix dotnet template command error when running with DotnetToolMode.

This PR intended to fix #8691 issue.

What's tested manually on my local environment

dotnet pack command
  • docfx.runtimesettings.json contains "Docfx.DotnetToolMode": true entry.
  • TargetFramework dependent templates(at tools/{$(TargetFramework)}/any/templates) are removed from package.
  • Template files are re-located to TargetFramework independent path (templates/**).
  • Install generated nupkg as .NET tools. and basic command works as expected.
dotnet publish command.
  • templates directory structure is not changed.
  • docfx.runtimesettings.json is not modified.

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (100d234) 77.59% compared to head (f46fb23) 77.59%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9115   +/-   ##
=======================================
  Coverage   77.59%   77.59%           
=======================================
  Files         592      592           
  Lines       24604    24607    +3     
=======================================
+ Hits        19091    19094    +3     
  Misses       5513     5513           
Files Changed Coverage Δ
src/docfx/Models/TemplateCommand.cs 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yufeih yufeih added the new-feature Makes the pull request to appear in "New Features" section of the next release note label Aug 23, 2023
Copy link
Contributor

@yufeih yufeih left a comment

Choose a reason for hiding this comment

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

This is Epic @filzrev !

@yufeih yufeih merged commit 9bbaa5d into dotnet:main Aug 23, 2023
@filzrev filzrev deleted the fix-template-folder-for-nupkg branch August 24, 2023 02:46
p-kostov pushed a commit to ErpNetDocs/docfx that referenced this pull request Jun 28, 2024
feat: enable DotnetToolMode option when creating nupkg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Makes the pull request to appear in "New Features" section of the next release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Use the same template directory for all target frameworks in .NET tool package
2 participants