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.
Thanks,
T.
curtisw
(Curtis Wensley)
December 12, 2024, 12:13am
2
Yep, this option simply adds this snippet to the end of the .csproj, so you can copy/paste into your project afterwards:
<Target Name="BuildYakPackage" AfterTargets="DispatchToInnerBuilds">
<PropertyGroup>
<YakExecutable Condition="$(YakExecutable) == '' and $([MSBuild]::IsOSPlatform(windows)) and Exists('C:\Program Files\Rhino 8\System\Yak.exe')">C:\Program Files\Rhino 8\System\Yak.exe</YakExecutable>
<YakExecutable Condition="$(YakExecutable) == '' and $([MSBuild]::IsOSPlatform(macos)) and Exists('/Applications/Rhino 8.app/Contents/Resources/bin/yak')">/Applications/Rhino 8.app/Contents/Resources/bin/yak</YakExecutable>
<BuildYakPackage Condition="$(BuildYakPackage) == '' and $(YakExecutable) != '' and Exists($(YakExecutable))">True</BuildYakPackage>
</PropertyGroup>
<Warning Text="Could not find Yak executable" Condition="$(YakExecutable) == ''" />
<ItemGroup>
<YakPackagesToDelete Include="$(OutputPath)\*.yak;$(OutputPath)\**\manifest.yml" />
</ItemGroup>
<Delete Files="@(YakPackagesToDelete)" />
<Exec Command=""$(YakExecutable)" spec" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" />
<Exec Command=""$(YakExecutable)" build" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" />
</Target>
Hope this helps!
1 Like
xliotx
February 5, 2025, 3:21pm
3
I was trying this option today and see two issue:
When building multi-target
project, only rh8
yak file was copied to the root bin
folder, the rh7
is in net48
folder and not copied out.
With the current mechanism, it seems impossible to add a customize icon (can only be done by manually build the package with yak.exe
.