Custom version
Hi
I try to create solution level package and control it version manually. I try various options available in the NuBuild but any of them is relevant for my case.
- Auto - i can control only the third number
- Library - i do not have any reference DLL nor other file.
- Manual - is not the case while i have more than one nuspec files to manage.
I investigate the possibilities and i think the best could be us ein nu spec $vesrion$ source Library and in the MSBuild project file set the Version property to some value. I found that i can use the replaceable for any MSBuild property so such option available for $version$ will be great extension point.
Hi again,
I found the solution is a little tricky but works.
In the nuproj file i add the target that deal with metadata before Build.
<Target Name="Version" BeforeTargets="BeforeBuild">
<ItemGroup>
<NuPrepared>
<NuPackageVersion>$(Version)</NuPackageVersion>
<NuPackagePath>$(MSBuildProjectDirectory)\$(OutputPath)%(NuPrepared.Filename).$(Version).nupkg</NuPackagePath>
</NuPrepared>
</ItemGroup>
</Target>
Where Version property is generated before this target.
This ware possible because of separation of tasks Prepare and Package.
I leave the issue opened, may other have something to add. If its OK to do such things (in terms of support in the feature) it could be closed.