cake-contrib / Cake_Git

Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp
https://cakebuild.net/extensions/cake-git
Other
39 stars 64 forks source link

Cake.Git v2.0.0 breaks IntelliSense in VS Code #160

Closed KatoStoelen closed 2 years ago

KatoStoelen commented 2 years ago

Originally posted here: cake-build/cake-vscode#614

Having an addin directive for Cake.Git v2.0.0 in a .cake file causes the following error when Omnisharp.Cake tries to load the file.

#addin "nuget:?package=Cake.Git&version=2.0.0"
[fail]: OmniSharp.Cake.CakeProjectSystem
        c:\path\to\workspace\build\build.cake will be ignored due to an following error
System.IO.FileNotFoundException: Cake is not installed. Path  does not exist.
   at OmniSharp.Cake.CakeProjectSystem.GetProject(CakeScript cakeScript, String filePath) in D:\a\1\s\src\OmniSharp.Cake\CakeProjectSystem.cs:line 281
   at OmniSharp.Cake.CakeProjectSystem.AddCakeFile(String cakeFilePath) in D:\a\1\s\src\OmniSharp.Cake\CakeProjectSystem.cs:line 125

Downgrading Cake.Git to 1.x.x solves the issue.

nils-a commented 2 years ago

I think this is a regression from #158, specifically adding the runtimes to the nupkg.

More specifically, removing the tools/addins/Cake.Git.2.0.0/runtimes/win-x46 folder "fixes" the error. (When running on windows, that is...) My feeling would be that having that dll twice in there throws off Cake.Bakery. Could that be possible, @bjorkstromm ?

bjorkstromm commented 2 years ago

I think this is a regression from #158, specifically adding the runtimes to the nupkg.

More specifically, removing the tools/addins/Cake.Git.2.0.0/runtimes/win-x46 folder "fixes" the error. (When running on windows, that is...) My feeling would be that having that dll twice in there throws off Cake.Bakery. Could that be possible, @bjorkstromm ?

Cake.Bakery should ignore everything in runtimes/ folder as these are not needed during compilation. Today, that might not be the case, since it's sharing NuGet logic with Cake (which needs stuff under /runtimes). Can we move this bug to Cake.Bakery repo?

gep13 commented 2 years ago

@bjorkstromm There already was an issue created in the bakery repository regarding this, and this issue was created afterwards. I would suggest closing this one and using the other.

bjorkstromm commented 2 years ago

@bjorkstromm There already was an issue created in the bakery repository regarding this, and this issue was created afterwards. I would suggest closing this one and using the other.

Wasn't it created in Cake-VSCode? E.g. this https://github.com/cake-build/cake-vscode/issues/614

gep13 commented 2 years ago

Doh! Sorry, you are right! That one we can move to bakery repository.

gep13 commented 2 years ago

@bjorkstromm I have moved the issue here: https://github.com/cake-build/bakery/issues/168

bjorkstromm commented 2 years ago

@bjorkstromm I have moved the issue here: https://github.com/cake-build/bakery/issues/168

Thanks @gep13! I'll go ahead and close this then.