Remove dependency on VersionTools in source builds

This commit is contained in:
Nick Guerrera 2017-10-17 10:47:27 -07:00
parent 26d8d75fef
commit c9eeef1790
2 changed files with 7 additions and 2 deletions

View file

@ -3,9 +3,12 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.VersionTools.Automation;
using System.IO;
#if !SOURCE_BUILD
using Microsoft.DotNet.VersionTools.Automation;
#endif
namespace Microsoft.DotNet.Cli.Build
{
public class UpdateVersionsRepo : Task
@ -21,6 +24,7 @@ namespace Microsoft.DotNet.Cli.Build
public override bool Execute()
{
#if !SOURCE_BUILD
string versionsRepoPath = $"build-info/dotnet/cli/{BranchName}";
GitHubAuth auth = new GitHubAuth(GitHubPassword);
@ -28,6 +32,7 @@ namespace Microsoft.DotNet.Cli.Build
repoUpdater.UpdateBuildInfoAsync(
Directory.GetFiles(PackagesDirectory, "*.nupkg"),
versionsRepoPath).Wait();
#endif
return true;
}

View file

@ -21,6 +21,6 @@
<PackageReference Include="NuGet.Protocol" Version="$(CLI_NuGet_Version)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(CLI_MSBuild_Version)" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.DotNet.VersionTools" Version="$(VersionToolsVersion)" />
<PackageReference Include="Microsoft.DotNet.VersionTools" Version="$(VersionToolsVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
</ItemGroup>
</Project>