Tuesday, November 26, 2013

Hedgehog TDS - Package Version

I wanted to create TDS packages using the version from the project assembly version.
Here's a piece of code that I finally figured out how to accomplish dynamically. Place at the bottom of your .scproj file.
<Import Project="$(MSBuildExtensionsPath)\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets" />
<ItemGroup>
<AssembliesPath Include="..\SomethingAwesome.Web\bin\SomethingAwesome.Web.dll" />
</ItemGroup>
<Target Name="BeforeSitecoreBuild">
<GetAssemblyIdentity AssemblyFiles="@(AssembliesPath)">
<Output TaskParameter="Assemblies" ItemName="AssemblyVersion" />
</GetAssemblyIdentity>
<CreateProperty Value="%(AssemblyVersion.Version)">
<Output TaskParameter="Value" PropertyName="PackageVersion" />
</CreateProperty>
</Target>

No comments:

Post a Comment