Hello,
Do you have a template csproj file that creates a Yak package after the Release build?
jmv
Hello,
Do you have a template csproj file that creates a Yak package after the Release build?
jmv
<Project Sdk="Microsoft.NET.Sdk">
<!-- These properties are used by the "Yak spec" command -->
<PropertyGroup>
<AssemblyTitle>...</AssemblyTitle>
<Version>...</Version> <!-- Or <InformationalVersion>...</InformationalVersion> -->
<Description>...</Description>
<Company>...</Company> <!-- Or [assembly: PlugInDescription (DescriptionType.Organization, ...)] -->
<!-- manifest.yml/url is only set by [assembly: PlugInDescription (DescriptionType.WebSite, ...]-->
</PropertyGroup>
...
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetExt>.rhp</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration) == 'Release'">
<OutDir>yak\$(Version)</OutDir>
</PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="$(Configuration) == 'Release'">
<Exec Command="echo Generate Yak package: $(Version)" />
<Delete Files="$(ProjectDir)$(OutDir)manifest.yml" />
<Exec WorkingDirectory="$(ProjectDir)$(OutDir)" Command='"C:\Program Files\Rhino 7\System\Yak.exe" spec' />
<Exec WorkingDirectory="$(ProjectDir)$(OutDir)" Command='"C:\Program Files\Rhino 7\System\Yak.exe" build' />
</Target>
</Project>
Thanks for providing this example!
I’d recommend only running the yak build
command in the project’s post-build step. The yak spec
command can be run manually and then the manifest.yml file should be edited, stored with the project and copied to the build directory before running yak build
.
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="$(Configuration) == 'Release'">
<Copy SourceFiles="manifest.yml" DestinationFolder="$(OutDir)" />
<!-- ... -->
</Target>
Additionally, specifying version: $version
in the manifest.yml file will prompt yak.exe to inject the plug-in’s version number at build time.
Ok, however, I understand that I’m not using the spec command as it was intended.
having to change a version number in several different places is a risk of error.
But that was before I knew version: $version
.
thank you for the answer !