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

Refactor design-time tools #5142

Merged
merged 2 commits into from
Apr 25, 2016
Merged

Refactor design-time tools #5142

merged 2 commits into from
Apr 25, 2016

Conversation

natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented Apr 21, 2016

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.

Resolves #4577
Resolves #5065
Partial fix for #3925

WIP - remaining work

Functional issues

  • Can't use dotnet-ef in a class library or standalone apps. This dies with "Could not resolve coreclr path". https://github.com/dotnet/cli/issues/2645
  • There are issues loading assemblies when startup project and current project are different. Haven't identified the source of the issue.
  • Cannot install into a csproj. Blocked on Cannot install Nuget.Common in csproj NuGet/Home#2635.
  • The framework/configuration on the dispatcher (dotnet-ef) should flow through to the "inside-man".

Cleanup

  • Put all strings into resx files
  • Remove workaround that runs dotnet restore --infer-runtimes on the tools projects. Without this, dotnet-pack fails, complaining that no runtimes were specified.
  • Merge Update list of EF packages aspnet/Coherence#79

cc @divega @NTaylorMullen @bricelam

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;
Copy link
Member

Choose a reason for hiding this comment

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

Sort usings

@AndriySvyryd
Copy link
Member

🐑 🇮🇹

=> Reporter.Error.WriteLine(message.Bold().Red());

protected override void WriteInformation(string message)
=> Reporter.Error.WriteLine(message);
Copy link
Contributor

Choose a reason for hiding this comment

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

Error for writeinformation?

@NTaylorMullen
Copy link
Contributor

@natemcmaster
Copy link
Contributor Author

I've added a new commit to this PR. It includes some response to feedback, cleanup, and fixed up some bugs.

27f6fa9

@natemcmaster natemcmaster changed the title [wip] Refactor design-time tools Refactor design-time tools Apr 25, 2016
{
var app = new CommandLineApplication()
{
Name = "Microsoft.EntityFrameworkCore.Tools.Cli",
Copy link
Contributor

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.

@lajones
Copy link
Contributor

lajones commented Apr 25, 2016

:shipit:

startupConfiguration,
startupFramework,
startupBuildBaseDir,
startupOutputDir)
buildBasePath: null,
Copy link
Contributor

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.

@NTaylorMullen
Copy link
Contributor

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.

:shipit: Feel free to bug me if you want anything specific looked over in detail.

@natemcmaster natemcmaster merged commit 33192ff into dotnet:release Apr 25, 2016
@natemcmaster natemcmaster deleted the tools branch April 25, 2016 23:53
natemcmaster added a commit to aspnet/Coherence that referenced this pull request Apr 25, 2016
natemcmaster pushed a commit to aspnet/Diagnostics that referenced this pull request Apr 26, 2016
natemcmaster pushed a commit to aspnet/Identity that referenced this pull request Apr 26, 2016
natemcmaster pushed a commit to aspnet/Entropy that referenced this pull request Apr 26, 2016
@natemcmaster natemcmaster mentioned this pull request Apr 26, 2016
4 tasks
natemcmaster pushed a commit to aspnet/Identity that referenced this pull request Apr 26, 2016
natemcmaster pushed a commit to aspnet/Diagnostics that referenced this pull request Apr 26, 2016
natemcmaster pushed a commit to aspnet/Entropy that referenced this pull request Apr 26, 2016
DotDeveloper95 added a commit to DotDeveloper95/Entropy that referenced this pull request Sep 4, 2023
DotDeveloper95 added a commit to DotDeveloper95/Entropy that referenced this pull request Sep 4, 2023
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.

5 participants