-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Refactor design-time tools #5142
Conversation
Split design-time tools into three packages so that users need only install "Microsoft.EntityFrameworkCore.Tools" and nuget will restore the tools they need for the platform they target. The packages: - .Tools - A pseudo-metapackage. This contains shims to call into shared components. - lib/net451/Microsoft.EntityFrameworkCore.Tools.dll - Contains PowerShell cmdlets and APIs that bridge it with common components. - lib/netcoreapp1.0/dotnet-ef.dll - a light shim for initializing commands on DotNet project. This executes from "tools". - lib/netcore50/Microsoft.EntityFrameworkCore.Tools.dll - same as net451. For compatibility with UWP only. This is never actually executed. - build/netcore50/*.target - swaps netcore50 to net451 at build time on UWP projects - tools/* - the powershell cmdlets - .Tools.Cli - A program to launch commands from dotnet-cli. These execute as a "dependency". - lib/netstandard1.5/*.dll - Contains the entry point for executing commands on a DotNet project model that supports .NET Core - lib/net451/*.exe - Contains the entry point for executing commands on a DotNet project modle that supports desktop .NET only - .Tools.Core - contains shared components. This contains the implementation details of executing commands.
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.EntityFrameworkCore.Scaffolding.Internal; | ||
using Microsoft.EntityFrameworkCore.Design.Internal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort usings
🐑 🇮🇹 |
=> Reporter.Error.WriteLine(message.Bold().Red()); | ||
|
||
protected override void WriteInformation(string message) | ||
=> Reporter.Error.WriteLine(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error for writeinformation?
⌚ |
I've added a new commit to this PR. It includes some response to feedback, cleanup, and fixed up some bugs. |
{ | ||
var app = new CommandLineApplication() | ||
{ | ||
Name = "Microsoft.EntityFrameworkCore.Tools.Cli", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is tied to this assembly you should use a typeof to ensure it stays consistent without needing to manually update.
startupConfiguration, | ||
startupFramework, | ||
startupBuildBaseDir, | ||
startupOutputDir) | ||
buildBasePath: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to allow a user to specify some of these so they don't get build output spewed in their current directory.
Took a look at the CLI side of things and seemed alright. Lots here though and I'm not 100% fluent in what the EF tooling is responsible for. Feel free to bug me if you want anything specific looked over in detail. |
Split design-time tools into three packages so that users need only install "Microsoft.EntityFrameworkCore.Tools" and nuget will restore the tools they need for the platform they target.
The packages:
components.
PowerShell cmdlets and APIs that bridge it with common components.
commands on DotNet project. This executes from "tools".
net451. For compatibility with UWP only. This is never actually
executed.
on UWP projects
"dependency".
commands on a DotNet project model that supports .NET Core
on a DotNet project modle that supports desktop .NET only
details of executing commands.
Resolves #4577
Resolves #5065
Partial fix for #3925
WIP - remaining work
Functional issues
Cleanup
dotnet restore --infer-runtimes
on the tools projects. Without this, dotnet-pack fails, complaining that no runtimes were specified.cc @divega @NTaylorMullen @bricelam