Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Merge pull request #778 from NuGet/dev
Browse files Browse the repository at this point in the history
[ReleasePrep][2020.05.05] RI of dev into master
  • Loading branch information
loic-sharma authored May 5, 2020
2 parents 918430b + 0bdb070 commit f253504
Show file tree
Hide file tree
Showing 155 changed files with 4,322 additions and 7,333 deletions.
3 changes: 1 addition & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param (
[string]$SemanticVersion = '1.0.0-zlocal',
[string]$Branch,
[string]$CommitSHA,
[string]$BuildBranch = 'd298565f387e93995a179ef8ae6838f1be37904f'
[string]$BuildBranch = '6d1fcf147a7af8b6b4db842494bc7beed3b1d0e9'
)

# For TeamCity - If any issue occurs, this script fails the build. - By default, TeamCity returns an exit code of 0 for all powershell scripts, even if they fail
Expand Down Expand Up @@ -127,7 +127,6 @@ Invoke-BuildStep 'Creating artifacts' {
"src\Ng\Catalog2Dnx.nuspec", `
"src\Ng\Catalog2icon.nuspec", `
"src\Ng\Catalog2Monitoring.nuspec", `
"src\Ng\Catalog2Registration.nuspec", `
"src\Ng\Db2Catalog.nuspec", `
"src\Ng\Db2Monitoring.nuspec", `
"src\Ng\Monitoring2Monitoring.nuspec", `
Expand Down
1 change: 1 addition & 0 deletions sign.thirdparty.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ThirdPartyBinaries Include="AnglicanGeek.MarkdownMailer.dll" />
<ThirdPartyBinaries Include="Autofac.dll" />
<ThirdPartyBinaries Include="Autofac.Extensions.DependencyInjection.dll" />
<ThirdPartyBinaries Include="Autofac.Integration.WebApi.dll" />
<ThirdPartyBinaries Include="Dapper.StrongName.dll" />
<ThirdPartyBinaries Include="dotNetRDF.dll" />
<ThirdPartyBinaries Include="Elmah.dll" />
Expand Down
84 changes: 0 additions & 84 deletions src/Catalog/FileSystemEmulatorHandler.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System;
using NuGet.Services.Metadata.Catalog.Helpers;

namespace NuGet.Services.Metadata.Catalog.Registration
namespace NuGet.Services.Metadata.Catalog
{
public class FlatContainerPackagePathProvider : IPackagePathProvider
public class FlatContainerPackagePathProvider
{
private readonly string _container;

Expand Down
86 changes: 0 additions & 86 deletions src/Catalog/Helpers/NuGetVersionUtility.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Linq;
using NuGet.Versioning;
using VDS.RDF;
using VDS.RDF.Query;

namespace NuGet.Services.Metadata.Catalog.Helpers
{
Expand Down Expand Up @@ -43,87 +39,5 @@ public static string GetFullVersionString(string version)

return parsedVersion.ToFullString();
}

public static bool IsVersionSemVer2(string version)
{
NuGetVersion parsedVersion;
if (!NuGetVersion.TryParse(version, out parsedVersion))
{
return false;
}

return parsedVersion.IsSemVer2;
}

public static bool IsVersionRangeSemVer2(string versionRange)
{
VersionRange parsedVersionRange;
if (!VersionRange.TryParse(versionRange, out parsedVersionRange))
{
return false;
}

if (parsedVersionRange.HasLowerBound && parsedVersionRange.MinVersion.IsSemVer2)
{
return true;
}

if (parsedVersionRange.HasUpperBound && parsedVersionRange.MaxVersion.IsSemVer2)
{
return true;
}

return false;
}

public static bool IsGraphSemVer2(string version, string resourceUri, IGraph graph)
{
// Is the package version itself SemVer 2.0.0?
if (IsVersionSemVer2(version))
{
return true;
}

if (resourceUri == null)
{
throw new ArgumentNullException(nameof(resourceUri));
}

if (graph == null)
{
throw new ArgumentNullException(nameof(graph));
}

// Is the verbatim version SemVer 2.0.0?
var parsedResourceUri = new Uri(resourceUri);
var verbatimVersion = graph.GetTriplesWithSubjectPredicate(
graph.CreateUriNode(parsedResourceUri),
graph.CreateUriNode(Schema.Predicates.VerbatimVersion)).FirstOrDefault()?.Object as ILiteralNode;
if (verbatimVersion != null && IsVersionSemVer2(verbatimVersion.Value))
{
return true;
}

// Are any of the dependency version ranges SemVer 2.0.0?
var sparql = new SparqlParameterizedString
{
CommandText = Utils.GetResource("sparql.SelectDistinctDependencyVersionRanges.rq")
};
sparql.SetUri("resourceUri", new Uri(resourceUri));
var query = sparql.ToString();

TripleStore store = new TripleStore();
store.Add(graph, true);
foreach (SparqlResult row in SparqlHelpers.Select(store, query))
{
var unparsedVersionRange = row["versionRange"].ToString();
if (IsVersionRangeSemVer2(unparsedVersionRange))
{
return true;
}
}

return false;
}
}
}
31 changes: 0 additions & 31 deletions src/Catalog/Helpers/SparqlHelpers.cs

This file was deleted.

Loading

0 comments on commit f253504

Please sign in to comment.