Comments (4)
I'm finally back from being away for so long, and started working on this (as the main outstanding issue for alpha 1).
I'm digging deeper into the .net code to see how they handled this on their side. Seems like the install.ps1 and uninstall.ps1 are no longer in use, and may be deprecated in the future, so I'm looking at alternative solutions.
The way EF Core are handling it is quite interesting/different. The user's end project will reference the Microsoft.EntityFrameworkCore.Design
package, which contains the actual code for migrations, db sync, etc. The Microsoft.EntityFrameworkCore.Tools
and Microsoft.EntityFrameworkCore.Tools.Dotnet
packages are just a "bootstrap" package, that uses the Design library from the end project to run the code.
We can't use the same approach, since we can't just reference the build tools and code analysers in the user's web project - that would be silly and would cause issues.
I'm checking a couple other tools libraries to see how they handle this issue
from r4mvc.
Digging deeper, I finally made some progress.. I've switched the name of the issue to change it into a discussion on tooling in general, rather than making it PS specific
First things first, I've managed to make the PowerShell tooling work in a reliable way. (i.e. it will pick up the latest version of the tools after each update without the need for a VS restart!) As such, I think we can go ahead with a first alpha (my MyGet fields are still being updated too).
Here's what I had so far in terms of a plan for the tools. We'll have two options that users can use. Both will provide the same level of functionality, the only difference is how they're invoked. While I'll strive to make them cross platform if possible, that doesn't seem to be an option at the moment, since MSBuild is only compiled against the full .NET framework. Once that changes, we should be able to make R4Mvc generation cross platform as well.
- PowerShell commands invoked in the
Package Manager Console
inside VSGet-R4MVCStatus
analyse the project, checking whether the project has any R4Mvc generated codeGenerate-R4MVC
main command that will invoke the R4Mvc generatorsRemove-R4MVC
will attempt to remove all custom code from the project (sans removing partial and virtual keywords)
- dotnet cli, which can be invoked either inside VS or from a command line in the project's path
dotnet r4mvc
default command showing whether the project has any R4Mvc generated code, as well as a short help message with usage examplesdotnet r4mvc generate
main command that invokes the R4Mvc generatorsdotnet r4mvc remove
- will attempt to remove the custom code from the project
Currently we only have the generate
command, and I'll only start on the others when the core functionality is finished, so the others are really a backlog issue.
dotnet cli support is also in progress, although it's not quite there yet. Seems like the project that contains the cli commands HAS to be multi platform, otherwise we won't be able to add it to most projects. That explains why EF has separate projects for the PowerShell and the dotnet cli tools.
from r4mvc.
@artiomchi looks like a good approach to me. Shall we open issues to track progress on each of the commands and then close this one?
from r4mvc.
Yup, that makes sense. I'll go over them and create 4 new issues to replace this one with a proper write-up this evening
from r4mvc.
Related Issues (20)
- Generation fails on msbuild warning HOT 2
- ActionNameAtttribute is not supported
- Video demo of R4MVC tag helpers HOT 2
- C#9 target-type new incompatibility HOT 1
- Error in New Visual Studio Version HOT 6
- Real Roslyn Source Code Generator ?
- Failure when controller contains several action methods with the same name HOT 4
- Public, static methods in a controller are being marked as virtual during generation
- Not Deteted Partial and RazorLayout
- Issue deleted
- Is R4MVC supposed to work with .Net6? HOT 2
- Not Generated Controller Action in New Visual Studeio Version 17.1.6
- Error When Generate R4MVC HOT 6
- Could not load SDK resolver HOT 1
- How to run Generate-R4MVC in visual studio on mac?
- Compatibility issue. HOT 1
- Add support for C# 10 and C# 11
- Add support for view-only pages within the /Pages hierarchy
- .net core 3.1 - The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop HOT 1
- Is this a dead project?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r4mvc.