I have a GH plugin built for Net48 and Net7.0 that needs to be installed for R7 and R8.
If I follow this structure and build the package using the last version from here I have blabla-0.0.1-any-any.yak, if I install this package in R7, the package will install, but GH will not load the library, which will instead work for R8.
Considering from Rhino 8 onwards, Yak also supports multi-targeted apps
Do we have to build 2 independent yak packages for R7 and R8 or one package targeting only Net48? Are these the only solutions, or am I missing something?
The other thing I noticed is.
Suppose I use yak as suggested here. I am constantly having this type of result blabla-0.0.1-any-any.yak even if I build into the specific folders for net48 or net7.0. In that case, it seems not able to define if rh7 or rh8 instead; if I use the compiled downloadable version, and I use it in a folder net48, I will have this type of result blabla-0.0.1-rh7_32-any if I use it into a folder net7.0 I will have this result blabla-0.0.1-rh8_13-any so I have a better result keep using the downloadable version.
In general, if you have Rhino installed I’d recommend using the yak.exe in the System directory. The downloadable yak.exe is meant for situations where Rhino is not installed, such as building and publishing packages on a build server.
I’m not sure why the Rhino version isn’t being populated when building a multi-targeted .NET plug-in package. We’ll have to look into that.
In your case, I’d recommend doing the following, using the yak.exe that ships with Rhino 8.
From the directory above the net48 and net7.0 folders, build your package. If the package filename ends with “-any-any.yak”, rename it to “-rh8_13-any.yak” (the “rh” version should be the version of RhinoCommon that you built against, i.e. Rhino 8 SR13).
Copy the contents of net48/ to a new directory (just to keep things clean!) and also copy the manifest.yml file. Then build another package from this directory. You should get something that ends with “-rh7_32-any.yak”, based on what you shared earlier.
You should now have two package files – one for Rhino 8 with net48 and net7.0 versions of your plug-in, and one for Rhino 7 (net48 only). They should both have the same package name and package version, e.g. “blabla-0.0.1-rh8_13-any.yak” and “blabla-0.0.1-rh7_32-any.yak”.
Publish both package files! They can both be published side-by-side to make use of the “distributions” feature of the package system.
This “-any-any.yak” if I use yak as suggested here. So, I extracted the yak.exe and DLLs from the Rhino8 system folder into a separate folder, and I have the any-any result, but if I run the yak.exe in the Rhino8 system folder, I have the rh8_13-any result.
I can also get the rh8_13-any if I use the downloadable version.
Based on your suggestions, this seems to be the best solution for now.
Downloadable yak.exe.
Build a multi-target package for Rh8, then build a package for Rh7. The final result will be. “blabla-0.0.1-rh8_13-any.yak” and “blabla-0.0.1-rh7_32-any.yak” .