Griff, this is what I have so far:
<Target Name="PreBuildMacros">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="Targets" />
</GetAssemblyIdentity>
<ItemGroup>
<PreBuildVersionNumber Include="@(Targets->'%(Version)')"/>
</ItemGroup>
</Target>
<PropertyGroup>
<PreBuildMacrosBuildEventDependsOn>
$(PreBuildEventDependsOn);
PreBuildMacros;
</PreBuildMacrosBuildEventDependsOn>
<PreBuildEvent>
echo PRE-BUILD ASSEMBLY VERSION IS: @(PreBuildVersionNumber)
</PreBuildEvent>
</PropertyGroup>
<Target Name="PostBuildMacros">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="Targets" />
</GetAssemblyIdentity>
<ItemGroup>
<PostBuildVersionNumber Include="@(Targets->'%(Version)')"/>
</ItemGroup>
</Target>
<PropertyGroup>
<PostBuildEventDependsOn>
$(PostBuildEventDependsOn);
PostBuildMacros;
</PostBuildEventDependsOn>
<PostBuildEvent>
echo POST-BUILD ASSEMBLY VERSION IS: @(PostBuildVersionNumber)
</PostBuildEvent>
</PropertyGroup>
I'm thinking that I could capture the both pre*build and post-build version numbers and pass them to this batch file:
@echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL DISABLEDELAYEDEXPANSION
if "%~1"=="" findstr "^::" "%~f0"&GOTO:EOF
for /f "tokens=1,* delims=]" %%A in ('"type %3|find /n /v """') do (
set "line=%%B"
if defined line (
call set "line=echo.%%line:%~1=%~2%%"
for /f "delims=" %%X in ('"echo."%%line%%""') do %%~X
) ELSE echo.
)
Except I can't seem to capture the pre-build version #. Working on it. I'll add the release version check when this is done.
Thanks