Hi there,
I love Rhino creating the YAK-packages for me automatically.
Now that I have an icon I realized that the package does not include the icon automatically when I refer to it in Visual Studio. The rest of the information is used perfectly fine though.
This would mean that I always have to add the reference to the icon manually, right?
Am I missing something?
If not, is it possible to implement something like that.
Thanks,
T.
Hi there,
I have a question.
Do I understand correctly that if I check the option “Build Yak Package” when creating a new Plugin, it will always create a Yak-Package when building the solution, using the information stored in the projects properties (version, autor, …)?
If so, is there a way to add this option once the project was created?
I simply forgot to check this option and I think it would be quite comfortable to have this created automatically.
[image]
Thanks,
T.
@will
Here I have a thread asking how to create a yak package automatically.
So far I can see that the icon/png is not referenced in the manifest.yml.
Do I have to add this manually each time or can this not be taken care of by the automatism when creating the yak-package automatically?
@curtisw @CallumSykes
Might this be a topic you can help with?
The automatic yak feature doesn’t include icons currently, you’d need to write your own task in the csproj for that.
Curtis and I do have ideas for improving the automatic yak packages and this is something we’d like to improve.
@CallumSykes thanks a lot.
Sounds intriguing, but not knowing how to write the task…
How hard would that be or me to do this?
I’m no expert on csproj tasks but the below should work, let me know if you have any issues.
Assuming you either
A - Ran dotnet new rhino -n <myproject> -yak
B - Checked the yak checkbox in the project wizard in Visual Studio
You should be able to find these 2 lines in your .csproj:
<Exec Command=""$(YakExecutable)" spec" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" />
<Exec Command=""$(YakExecutable)" build" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" />
Replace them with these lines:
<Exec Command=""$(YakExecutable)" spec" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" />
<!-- Copy icon -->
<Copy SourceFiles="$(MSBuildProjectDirectory)/icon.png" DestinationFolder="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" />
<!-- Add icon to manifest.yml -->
<WriteLinesToFile File="$(OutputPath)/manifest.yml" Lines="icon: icon.png" Overwrite="false" WriteOnlyWhenDifferent="true" />
<Exec Command=""$(YakExecutable)" build" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" />
The icon should now be included in the yak package.
@CallumSykes
Works!
Very nice, thank you!