-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Dependency on local copies of CommandLine libs #18
Comments
I'm sorry for the poor/outdated documentation. The latest version of the sample template SimplePocos is here - and it doesn't require you to rebuild our forked version of System.CommandLine. All nuget dependencies are published. (To run templates like SimplePoco you don't need to rebuild the library and toolkit). If you need to rebuild all libraries and tools, there are PowerShell scripts in the src folder. The right order would be:
|
Thank you for fast response! I was able to run the template using Unless I do something wrong. |
I also stumbled upon a confusion around |
Did you open SimplePocos.csproj in Visual Studio? Did it restore the nuget references? And yet you don't get intellisense? |
Microsoft ILogger takes only a regular string, which doesn't allow messages to use colors, that's why I've used my own. But yeah, probably I should add support for injecting a regular MS ILogger.
Despite having async definition (I forgot the reason), the methods are all sync, so it doesn't matter if you await the task or not. And in case it makes it easier for users who are not familiar with async/await (template entry point can be sync or async). |
In fact I created my own project with the same dependencies as yours and it doesn't compile. Now tried the same with your solution and see the same build error. (Just in case I use Rider, but I don't expect any difference in build behavior). |
Yes, I know that it doesn't support colors. I use In my opinion, it is better to rename your class somehow. Otherwise it would be always a confusion. The same is valid for Sorry for being picky! :) I think it's a great project, and would like to see it go further. |
I just remembered: logs can go to console (which doesn't need async) but they can also go to Visual Studio Output Window (which needs to be async). So different loggers (one being async) implement the same interface - that's why the interface is async. And as I've explained before, the examples are not awaiting because they don't need to. When the template is invoked using the CLI the logger implementation returns immediately, and if the template is invoked through VS Extension then the unawaited call also work fine. To sum, while templates are running they can update their progress status - this is what is called logging here. Even though it's currently not logging into text files, it's logging into other sinks (console or VS output). Hope it makes sense. Thank you for your suggestions and feedback. |
In the past I've published a nuget package which was refering to this private nuget dependency ( |
I've missed that. |
Rick, I tried to open your solution where SimplePoco is located. Got the
same result. The screenshot I provided us from an attempt to build your
solution.
Custom build scripts won't help here because the IDE builds sources itself
in background. It cannot get all necessary dependencies (your private build
of Command Line library is transitively referenced by your Runtime library)
and falls.
If you cannot link to the officially released command line package, then
maybe you can bundle your forked version to your library? Likely it will
solve the problem.
…On Tue, Jun 6, 2023, 19:25 Rick Drizin ***@***.***> wrote:
I created my own project with the same dependencies as yours
I've missed that.
So.. probably you're pointing to the CSPROJ instead of using the NUGET,
right? In this case, CSPROJ will need those local versions. So.. getting
back to my first reply - did you try the build-external.ps1? It should
build all forked versions that you need.
—
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2ZVO2OV7BXFUGESQ4PSLXJ5RZNANCNFSM6AAAAAAY3IBPS4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ok, I found out what happened: CodegenCS.Models 3.0.0 was published with those bad references (System.CommandLine private version). Since CodegenCS.Models.DbSchema 3.0.0 (which is still the latest) was built using CodegenCS.Models 3.0.0, it still has this transitive dependency of the private version. Quick fix: add |
Yes, it helped. Thank you very much! But please consider my opinion around |
Sure thing. How would you call that class to avoid this confusion? I'll also investigate if I can replace my colorful console by the aforementioned Spectre.Console. |
Maybe something around |
…ed to 3.0.1: 3.0.0 versions will be deprecated, since they were using CodegenCS.Models 3.0.0 which was also deprecated because it was published with a bad dependency - private nuget So basically the build was failing unless you build all submodules. Refs #18
… to 3.0.1 (3.0.0 nuget had a bad dependency - Refs Drizin/CodegenCS#18). Updating csprojs to net6.0 (but they should run in any version - from net472+, netcoreapp2.0+, and net5.0+)
FWIW now templates can be written using async Tasks. |
I tried to make my own code-gen project by following "SimplePocos" example, but the project cannot be compiled because the library depends on two local copies of the CommandLine project libraries:
Is it possible maybe to update it to the latest published beta4 version?
The text was updated successfully, but these errors were encountered: