Skip to content

Commit

Permalink
Disable prerelease feature for nuget2bazel (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszstrejczek authored May 18, 2021
1 parent 2c9f9c8 commit 64ad748
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
21 changes: 21 additions & 0 deletions tests/tools/nuget2bazel/MicrosoftConfigurationT.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Linq;
using System.Threading.Tasks;
using nuget2bazel;
using Xunit;

namespace nuget2bazel_test
{
public class MicrosoftConfigurationT : TestBase
{
// If we allow prerelease versions then this test fails for 5.9.0, 5.9.1 and 5.10.0-preview.
// It seems that there is an internal error in Nuget.Resolver related to sorting versions.
[Fact]
public async Task MicrosoftConfigurationTest()
{
var project = new TestProject(_prjConfig);
var addCmd = new AddCommand();

await addCmd.DoWithProject("https://api.nuget.org/v3/index.json", "Microsoft.Extensions.Configuration", "5.0.0", project, false);
}
}
}
2 changes: 1 addition & 1 deletion tests/tools/nuget2bazel/nuget2bazel-test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>nuget2bazel_test</RootNamespace>

<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion tools/nuget2bazel/AddCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task DoWithProject(string nugetSource, string package, string versi
PackagesFolderNuGetProject = project
};

const bool allowPrereleaseVersions = true;
const bool allowPrereleaseVersions = false;
const bool allowUnlisted = false;
var resolutionContext = new ResolutionContext(
lowest ? DependencyBehavior.Lowest : DependencyBehavior.HighestMinor, allowPrereleaseVersions, allowUnlisted, VersionConstraints.None);
Expand Down
2 changes: 1 addition & 1 deletion tools/nuget2bazel/UpdateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task DoWithProject(string nugetSource, string package, string versi
PackagesFolderNuGetProject = project
};

const bool allowPrereleaseVersions = true;
const bool allowPrereleaseVersions = false;
const bool allowUnlisted = false;
var resolutionContext = new ResolutionContext(
lowest ? DependencyBehavior.Lowest : DependencyBehavior.HighestMinor, allowPrereleaseVersions, allowUnlisted, VersionConstraints.None);
Expand Down
2 changes: 1 addition & 1 deletion tools/nuget2bazel/nuget2bazel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
13 changes: 0 additions & 13 deletions tools/nuget2bazel/nuget2bazel.sln.DotSettings.user

This file was deleted.

0 comments on commit 64ad748

Please sign in to comment.