cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.89k stars 726 forks source link

Cake --boostrap should uninstall and/or use same as specified in #module directive #2525

Open devlead opened 5 years ago

devlead commented 5 years ago

I updated a script from

#module nuget:?package=Cake.DotNetTool.Module&version=0.1.0

to

#module nuget:?package=Cake.DotNetTool.Module&version=0.2.0

--bootstrap installed the new version of the module, but the old one is still there

tools\modules
+---Cake.DotNetTool.Module.0.1.0
|   \---lib
|       \---netstandard2.0
\---Cake.DotNetTool.Module.0.2.0
    \---lib
        \---netstandard2.0

and the old being loaded and warnings still present even new available

- The assembly 'Cake.DotNetTool.Module, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null'
- is referencing an older version of Cake.Core (0.30.0).
- For best compatibility it should target Cake.Core version 0.33.0.
- Could not load module - '/tools/Modules/Cake.DotNetTool.Module.0.2.0/lib/netstandard2.0/Cake.DotNetTool.Module.dll'.

Expected behavior would be to load the new version.

Possible solutions would be to uninstall versions that don't match during bootstrap, load latest version of each module, find a way for assembly scanning to pick specified version.

@cake-build/cake-team thoughts?

gep13 commented 5 years ago

@devlead this seems like a good idea to me.

patriksvensson commented 5 years ago

@gep13 @devlead Perhaps we can wait with this one until #2333 have been merged?

devlead commented 5 years ago

@patriksvensson sure