Source

xUnit++ / vsix.msbuild

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="BuildVsix" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <UsingTask
        AssemblyFile=".build\MSBuild.ExtensionPack.dll"
        TaskName="MSBuild.ExtensionPack.Compression.Zip"/>

    <PropertyGroup>
        <RunnerBin>bin\xUnit++.VsRunner\xUnit++.VsRunner.x86.dll</RunnerBin>
        <RunnerSource>xUnit++.VsRunner\</RunnerSource>
        <LicenseSource>LICENSE</LicenseSource>
    </PropertyGroup>

    <Target Name="BuildVsix">
        <ItemGroup>
            <ZipItems
                Include="$(RunnerBin);$(RunnerSource)[Content_Types].xml;$(RunnerSource)*.ico;$(LicenseSource)" />
        </ItemGroup>

        <Delete Files="$(OutputPath)xunit.runner.visualstudio.vsix" />
        <Delete Files="$(OutputPath)xunit.runner.visualstudio.vsix.zip" />

        <Zip ZipFileName="$(OutputPath)xunit.runner.visualstudio.vsix.zip" Files="@(ZipItems)" StripPath="true" />
        <Copy SourceFiles="$(OutputPath)xunit.runner.visualstudio.vsix.zip" DestinationFiles="$(OutputPath)xunit.runner.visualstudio.vsix" />
        <Delete Files="$(OutputPath)xunit.runner.visualstudio.vsix.zip" />
    </Target>
</Project>