<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->


<Project DefaultTargets="DoRelease" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <ItemGroup>
    <WixReleaseTarget Include="BuildRelease" Condition=" '$(Push)'=='' " />
    <WixReleaseTarget Include="Release" Condition=" '$(NoPush)'=='' " />
  </ItemGroup>

  <Target Name="DoRelease">
    <Error Text="Cannot locate project's private/public keypair at: $(OfficialBuildPrivateKeyPair). Ensure that the OfficialBuildPrivateKeyPair arguments are correct." Condition=" !Exists('$(OfficialBuildPrivateKeyPair)') " />
    <Error Text="Azure StorageAccount is not specified. Ensure that the StorageAccount argument is correct." Condition=" '$(StorageAccount)'=='' " />
    <Error Text="Azure StorageAuthentication is not specified. Ensure that the StorageAuthentication argument is correct." Condition=" '$(StorageAuthentication)'=='' " />

    <MSBuild Projects="WixBuildRelease.proj"
             Properties="OfficialBuildPrivateKeyPair=$(OfficialBuildPrivateKeyPair);StorageAccount=$(StorageAccount);StorageAuthentication=$(StorageAuthentication);GithubUser=$(GithubUser);GithubPassword=$(GithubPassword)"
             Targets="@(WixReleaseTarget)"
             BuildInParallel="false"
             StopOnFirstFailure="true"
             UnloadProjectsOnCompletion="true" />
  </Target>
</Project>
