Closed amis92 closed 4 years ago
A single global tool makes sense, would there be any issues with it getting out of sync with the CodeGeneration.Roslyn*
packages?
Yes, a global tool wouldn't resolve any problems like that.
Making it a global/local tool is only for making it target netcoreapp3.0+ possible. No other gains here.
The ideal to strive for IMO is that clone, restore, build works for a consumer. If that breaks because of some extra steps that must be injected (like a dotnet tool install
command), then it'll be a hard sell for me.
Couldn't a local tool installed with a task while building? So clone, restore, build works.
Several potential problems with that, @LokiMidgard:
dotnet.exe
might not be installedThe network dependency is the most concerning. It's so concerning in fact, that that's the main reason why restore and build are separate steps for almost all toolsets (that I'm familiar with, anyway). Having build require a network dependency to do something that should have happened during restore is pretty hacky, IMO. And something I'd like to avoid.
I'm not even sure where we are now, so maybe an extra step to install a tool beyond what restore does already is required for users of this project.
I'm not even sure where we are now, so maybe an extra step to install a tool beyond what restore does already is required for users of this project.
It kind of is, not direct but still: DotNetCliToolReference
we use right now to "install" the tool requires:
dotnet.exe
SDK v2.x (not sure it works with just SDK v3.0)Switching dotnet-codegen
to be a local tool as specified in https://github.com/dotnet/cli/issues/10288 yields the following changes:
dotnet.exe
-based installation scenario instead of manual editing project files; the tool installation is "saved" in a dotnet-tools.json
filedotnet tool restore
- it is separate from dotnet restore
AFAIKIf, at some point, we need to target netcoreapp3.0
, there'll be no alternative, really. Right now we can just keep it as it is - but quite possibly in future we'll need to make the jump anyway.
Note for self: This will be obsolete when #198 is merged; it'll solve most of what this proposal could fix, and in some ways it's better.
Since the
DotNetCliToolReference
s are being deprecated and the suggested replacement is Local Tools, I propose to follow the suggestion.That is, move away from the current usage scenario and publish the
dotnet-codegen
package as the DotnetTool format.The timeframe is probably to be around SDK v3 final release. However we can consider an earlier switch, because it's usable as-is, although it currently needs to be installed as a Global Tool instead of a per-repo/project Local Tool (that's the scenario enabled by SDK v3).
Thoughts/opinions?