带变量的Msbuild任务

时间:2012-10-15 09:12:04

标签: msbuild msbuild-task

我希望$(fooAssemblyInfo.Version)在我的BuildRepositoryZip任务中工作,但它不是。为什么?我是否必须移出ItemName或者远离Target assemblyversion,在那种情况下是如何完成的?

<Target Name="AssemblyVersion">
    <GetAssemblyIdentity AssemblyFiles="..\Tools\Utility.dll">
        <Output TaskParameter="Assemblies" ItemName="fooAssemblyInfo"/>
    </GetAssemblyIdentity>
    <Message Text="%(fooAssemblyInfo.Version)" />
</Target>




<!-- Zipping all *.zip to a package for repository server-->
<Target Name="BuildRepositoryZip" DependsOnTargets="AssemblyVersion">
            <!-- Create a zip file based on a Path -->
    <MSBuild.ExtensionPack.Compression.Zip TaskAction="Create" CompressPath="..\..\Deploy\*.zip" ZipFileName="..\..\$(fooAssemblyInfo.Version).zip"/>

</Target>

0 个答案:

没有答案