Skip to content

Refactor design-time tools - #5142

Merged
natemcmaster merged 2 commits into
dotnet:releasefrom
natemcmaster:tools
Apr 25, 2016
Merged

natemcmaster merged 2 commits into
dotnet:releasefrom
natemcmaster:tools

Conversation

@natemcmaster

@natemcmaster natemcmaster commented Apr 21, 2016 •

Copy link
Copy Markdown
Contributor

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

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
Copy Markdown
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
Copy Markdown
Member

🐑 🇮🇹

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

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

Copy link
Copy Markdown

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
Copy Markdown

⌚

@natemcmaster

Copy link
Copy Markdown
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
Copy Markdown

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

lajones commented Apr 25, 2016

Copy link
Copy Markdown
Contributor

:shipit:

startupFramework,
startupBuildBaseDir,
startupOutputDir)
buildBasePath: null,

Copy link
Copy Markdown

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
Copy Markdown

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
sdpotgo996 added a commit to sdpotgo996/Identity that referenced this pull request Jan 21, 2026
sdpotgo996 added a commit to sdpotgo996/Identity that referenced this pull request Jan 21, 2026
sdpotgo996 added a commit to sdpotgo996/Diagnostics that referenced this pull request Jan 21, 2026
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