I’ve recently tried using Yak to package up a plugin, but have run into some very odd behaviour. There are two odd/broken behaviours.
The first behaviour doesn’t seems to have anything to do with the plugin itself, but rather the length of the path to the plugin’s assemblies–it even exists when packaging up the Visual Studio “RhinoCommon Plug-In for Rhino3D(C#)” project if its path is long enough. For the rest of the post, I’ll only be using that template project. So if you wish to reproduce, just use this:
The projects in both directories are exactly the same, but one has a longer path than the other. The project with the longer path has all the has this behaviour: the version detected by yak is the assembly version (1.0) but then appended with a long (non-sense?) string of numbers and letters.
The second behaviour happens regardless of the path to the plugin’s assemblies: The data that was specified in the manifest.yml file isn’t populated. And the version selection dropdown is broken. Even when multiple version are installed, the dropdown is still empty.
Thanks for the detailed steps! I was able to reproduce the behaviour that you’re seeing and found something curious. The extra build metadata is added to the version number (after the “+”) by the .NET build process. I did some digging and found that this is actually the git commit SHA, since the second (long path) project is inside the cloned rhino-developer-samples git repo.
You can disable this by adding <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> to your csproj file.
For example:
...
<PropertyGroup>
<!-- Specifies information for Assembly and Yak -->
<Version>1.0</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Title>MyRhinoPlugin</Title>
<Company>MyRhinoPlugin Authors</Company>
<Description>Description of MyRhinoPlugin</Description>
</PropertyGroup>
...
And after doing this and checking on the package using the “PackageManager” command, I cannot see any of the data from the manifest file, other than the version:
Thank you very much for figuring that out! It does fix the warning I’ve encountered with using “yak.exe build”. It also makes using the $version entry in the manifest usable (otherwise the version reported in Rhino would include SHA string).
However, it doesn’t seem to affect the other issues I’m experiencing with the manifest info not getting populated in Rhino though and the version dropdown not working in the PackageManager window.
Again, let me know if there’s something I can do to help narrow it down.