1 type derived from SemanticVersion
NuGet.Versioning (1)
NuGetVersion.cs (1)
14
public partial class NuGetVersion :
SemanticVersion
7 instantiations of SemanticVersion
Microsoft.DotNet.NuGetRepack.Tasks (3)
src\NuGetVersionUpdater.cs (2)
185
newPackageVersion = new
SemanticVersion
(packageVersion.Major, packageVersion.Minor, packageVersion.Patch);
199
newPackageVersion = new
SemanticVersion
(
src\ReplacePackageParts.cs (1)
250
return new
SemanticVersion
(currentVersion.Major, currentVersion.Minor, currentVersion.Patch, NewVersionSuffix);
NuGet.Protocol (3)
Plugins\ProtocolConstants.cs (2)
19
public static readonly SemanticVersion CurrentVersion = new
SemanticVersion
(major: 2, minor: 0, patch: 0);
24
public static readonly SemanticVersion Version100 = new
SemanticVersion
(major: 1, minor: 0, patch: 0);
Resources\ServiceIndexResourceV3.cs (1)
31
private static readonly SemanticVersion _defaultVersion = new
SemanticVersion
(0, 0, 0);
NuGet.Versioning (1)
SemanticVersionFactory.cs (1)
82
version = new
SemanticVersion
(version: ver,
207 references to SemanticVersion
dotnet (10)
Commands\New\BuiltInTemplatePackageProvider.cs (10)
56
IReadOnlyDictionary<string,
SemanticVersion
> parsedNames = GetVersionDirectoriesInDirectory(templatesRootFolder);
75
private static IReadOnlyDictionary<string,
SemanticVersion
> GetVersionDirectoriesInDirectory(string fullPath)
77
var versionFileInfo = new Dictionary<string,
SemanticVersion
>();
81
if (
SemanticVersion
.TryParse(Path.GetFileName(directory), out
SemanticVersion
? versionInfo) && versionInfo is not null)
90
internal static IList<string> GetBestVersionsByMajorMinor(IReadOnlyDictionary<string,
SemanticVersion
> versionDirInfo)
92
IDictionary<string, (string path,
SemanticVersion
version)> bestVersionsByBucket = new Dictionary<string, (string path,
SemanticVersion
version)>();
95
foreach (KeyValuePair<string,
SemanticVersion
> dirInfo in versionDirInfo)
102
if (!bestVersionsByBucket.TryGetValue(coreAppVersion, out (string path,
SemanticVersion
version) currentHighest)
Microsoft.DotNet.Arcade.Sdk (13)
src\CheckRequiredDotNetVersion.cs (4)
38
if (!
SemanticVersion
.TryParse(SdkVersion, out
var
currentSdkVersion))
90
if (!
SemanticVersion
.TryParse(minSdkVersionStr, out
var
minSdkVersion))
src\CompareVersions.cs (4)
29
if (!
SemanticVersion
.TryParse(Left, out
var
left))
35
if (!
SemanticVersion
.TryParse(Right, out
var
right))
src\InstallDotNetCore.cs (5)
77
if (runtimeItems.SelectMany(r => r.Value).Select(r => r.Key).FirstOrDefault(f => !
SemanticVersion
.TryParse(f, out
SemanticVersion
version)) != null)
103
SemanticVersion
version = null;
105
if (!
SemanticVersion
.TryParse(item.Key, out version))
115
else if (!
SemanticVersion
.TryParse(property.EvaluatedValue, out version))
Microsoft.DotNet.NuGetRepack.Tasks (14)
src\NuGetVersionUpdater.cs (8)
28
public
SemanticVersion
OldVersion { get; }
29
public
SemanticVersion
NewVersion { get; }
38
SemanticVersion
oldVersion,
39
SemanticVersion
newVersion,
128
SemanticVersion
packageVersion = null;
129
SemanticVersion
newPackageVersion = null;
168
if (!
SemanticVersion
.TryParse(packageVersionStr, out packageVersion))
398
private static NuGetVersion ToNuGetVersion(
SemanticVersion
version)
src\ReplacePackageParts.cs (6)
109
SemanticVersion
packageVersion = null;
164
if (!
SemanticVersion
.TryParse(versionStr, out packageVersion))
235
private
SemanticVersion
GetNewVersion(
SemanticVersion
currentVersion)
239
if (
SemanticVersion
.TryParse(NewVersion, out
var
newVersion))
Microsoft.NET.Build.Containers (11)
Tasks\ComputeDotnetBaseImageAndTag.cs (11)
141
private string UbuntuCodenameForSDKVersion(
SemanticVersion
version)
143
if (version >=
SemanticVersion
.Parse("8.0.300"))
155
if (ComputeVersionPart() is (string baseVersionPart,
SemanticVersion
parsedVersion, bool versionAllowsUsingAOTAndExtrasImages))
244
private (string,
SemanticVersion
, bool)? ComputeVersionPart()
246
if (
SemanticVersion
.TryParse(TargetFrameworkVersion, out
var
tfm) && tfm.Major < FirstVersionWithNewTaggingScheme)
251
else if (
SemanticVersion
.TryParse(SdkVersion, out
var
version))
269
private string? ComputeVersionInternal(
SemanticVersion
version,
SemanticVersion
? tfm)
345
private string ParseSemVerToMajorMinor(string semver) =>
SemanticVersion
.Parse(semver).ToString("x.y", VersionFormatter.Instance);
NuGet.CommandLine.XPlat (32)
_generated\16\PackageSearchJsonContext.NuGetVersion.g.cs (32)
157
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
159
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Major,
167
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Major", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
177
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
179
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Minor,
187
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Minor", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
197
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
199
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Patch,
207
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Patch", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
217
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
219
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).ReleaseLabels,
227
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("ReleaseLabels", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IEnumerable<string>), global::System.Array.Empty<global::System.Type>(), null),
238
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
240
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Release,
248
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Release", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
259
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
261
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).IsPrerelease,
269
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("IsPrerelease", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
279
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
281
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).HasMetadata,
289
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("HasMetadata", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
299
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
301
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Metadata,
309
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Metadata", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
335
writer.WriteNumber(PropName_Major, ((global::NuGet.Versioning.
SemanticVersion
)value).Major);
336
writer.WriteNumber(PropName_Minor, ((global::NuGet.Versioning.
SemanticVersion
)value).Minor);
337
writer.WriteNumber(PropName_Patch, ((global::NuGet.Versioning.
SemanticVersion
)value).Patch);
339
IEnumerableStringSerializeHandler(writer, ((global::NuGet.Versioning.
SemanticVersion
)value).ReleaseLabels);
340
writer.WriteString(PropName_Release, ((global::NuGet.Versioning.
SemanticVersion
)value).Release);
341
writer.WriteBoolean(PropName_IsPrerelease, ((global::NuGet.Versioning.
SemanticVersion
)value).IsPrerelease);
342
writer.WriteBoolean(PropName_HasMetadata, ((global::NuGet.Versioning.
SemanticVersion
)value).HasMetadata);
343
writer.WriteString(PropName_Metadata, ((global::NuGet.Versioning.
SemanticVersion
)value).Metadata);
NuGet.Packaging (1)
PackageCreation\Authoring\PackageBuilder.cs (1)
498
private static void ValidateDependencies(
SemanticVersion
? version,
NuGet.Protocol (74)
_generated\10\JsonContext.NuGetVersion.g.cs (32)
157
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
159
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Major,
167
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Major", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
177
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
179
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Minor,
187
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Minor", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
197
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
199
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Patch,
207
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Patch", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
217
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
219
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).ReleaseLabels,
227
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("ReleaseLabels", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IEnumerable<string>), global::System.Array.Empty<global::System.Type>(), null),
238
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
240
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Release,
248
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Release", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
259
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
261
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).IsPrerelease,
269
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("IsPrerelease", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
279
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
281
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).HasMetadata,
289
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("HasMetadata", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty<global::System.Type>(), null),
299
DeclaringType = typeof(global::NuGet.Versioning.
SemanticVersion
),
301
Getter = static obj => ((global::NuGet.Versioning.
SemanticVersion
)obj).Metadata,
309
AttributeProviderFactory = static () => typeof(global::NuGet.Versioning.
SemanticVersion
).GetProperty("Metadata", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
335
writer.WriteNumber(PropName_major, ((global::NuGet.Versioning.
SemanticVersion
)value).Major);
336
writer.WriteNumber(PropName_minor, ((global::NuGet.Versioning.
SemanticVersion
)value).Minor);
337
writer.WriteNumber(PropName_patch, ((global::NuGet.Versioning.
SemanticVersion
)value).Patch);
339
IEnumerableStringSerializeHandler(writer, ((global::NuGet.Versioning.
SemanticVersion
)value).ReleaseLabels);
340
writer.WriteString(PropName_release, ((global::NuGet.Versioning.
SemanticVersion
)value).Release);
341
writer.WriteBoolean(PropName_isPrerelease, ((global::NuGet.Versioning.
SemanticVersion
)value).IsPrerelease);
342
writer.WriteBoolean(PropName_hasMetadata, ((global::NuGet.Versioning.
SemanticVersion
)value).HasMetadata);
343
writer.WriteString(PropName_metadata, ((global::NuGet.Versioning.
SemanticVersion
)value).Metadata);
Converters\SemanticVersionConverter.cs (5)
20
public override bool CanConvert(Type objectType) => objectType == typeof(
SemanticVersion
);
29
/// <returns>A <see cref="
SemanticVersion
" /> object.</returns>
32
return reader.TokenType != JsonToken.Null ?
SemanticVersion
.Parse(serializer.Deserialize<string>(reader)!) : null;
43
var
semanticVersion = (
SemanticVersion
)value!;
Model\ServiceIndexEntry.cs (2)
27
public
SemanticVersion
ClientVersion { get; }
29
public ServiceIndexEntry(Uri serviceUri, string serviceType,
SemanticVersion
clientVersion)
Plugins\Connection.cs (1)
53
public
SemanticVersion
ProtocolVersion { get; private set; }
Plugins\ConnectionOptions.cs (4)
26
public
SemanticVersion
MinimumProtocolVersion { get; }
31
public
SemanticVersion
ProtocolVersion { get; }
60
SemanticVersion
protocolVersion,
61
SemanticVersion
minimumProtocolVersion,
Plugins\IConnection.cs (1)
41
SemanticVersion
ProtocolVersion { get; }
Plugins\Messages\HandshakeRequest.cs (4)
22
public
SemanticVersion
ProtocolVersion { get; }
28
public
SemanticVersion
MinimumProtocolVersion { get; }
42
public HandshakeRequest(
SemanticVersion
protocolVersion,
SemanticVersion
minimumProtocolVersion)
Plugins\Messages\HandshakeResponse.cs (2)
28
public
SemanticVersion
ProtocolVersion { get; }
45
public HandshakeResponse(MessageResponseCode responseCode,
SemanticVersion
protocolVersion)
Plugins\ProtocolConstants.cs (2)
19
public static readonly
SemanticVersion
CurrentVersion = new SemanticVersion(major: 2, minor: 0, patch: 0);
24
public static readonly
SemanticVersion
Version100 = new SemanticVersion(major: 1, minor: 0, patch: 0);
Plugins\RequestHandlers\SymmetricHandshake.cs (8)
22
private readonly
SemanticVersion
_minimumProtocolVersion;
24
private readonly
SemanticVersion
_protocolVersion;
43
SemanticVersion
protocolVersion,
44
SemanticVersion
minimumProtocolVersion)
112
/// The task result (<see cref="Task{TResult}.Result" />) returns a <see cref="
SemanticVersion
" />
116
public async Task<
SemanticVersion
> HandshakeAsync(CancellationToken cancellationToken)
189
SemanticVersion
negotiatedProtocolVersion;
208
private bool IsSupportedVersion(
SemanticVersion
requestedProtocolVersion)
Providers\ServiceIndexResourceV3Provider.cs (4)
233
if (!
SemanticVersion
.TryParse(index.Version, out
SemanticVersion
version) || version.Major != 3)
255
SemanticVersion
version;
256
if (
SemanticVersion
.TryParse((string)versionToken, out version) &&
Resources\ServiceIndexResourceV3.cs (9)
31
private static readonly
SemanticVersion
_defaultVersion = new SemanticVersion(0, 0, 0);
182
var clientVersions = new List<
SemanticVersion
>();
191
if (
SemanticVersion
.TryParse(versionString, out
SemanticVersion
? semVer))
200
foreach (
var
clientVersion in clientVersions)
254
var clientVersions = new List<
SemanticVersion
>();
266
SemanticVersion
version;
267
if (
SemanticVersion
.TryParse(versionString, out version))
277
foreach (
var
version in clientVersions)
NuGet.Versioning (52)
IVersionComparer.cs (2)
12
public interface IVersionComparer : IEqualityComparer<
SemanticVersion
>, IComparer<
SemanticVersion
>
NuGetVersionFactory.cs (1)
300
if (TryParse(value, out
SemanticVersion
? semVer))
SemanticVersion.cs (1)
26
public SemanticVersion(
SemanticVersion
version)
SemanticVersionBase.cs (22)
12
public partial class SemanticVersion : IFormattable, IComparable, IComparable<
SemanticVersion
>, IEquatable<
SemanticVersion
>
89
return CompareTo(obj as
SemanticVersion
);
95
public virtual int CompareTo(
SemanticVersion
? other)
105
return Equals(obj as
SemanticVersion
);
111
public virtual bool Equals(
SemanticVersion
? other)
122
public virtual bool Equals(
SemanticVersion
? other, VersionComparison versionComparison)
135
public virtual int CompareTo(
SemanticVersion
? other, VersionComparison versionComparison)
148
public static bool operator ==(
SemanticVersion
? version1,
SemanticVersion
? version2)
156
public static bool operator !=(
SemanticVersion
? version1,
SemanticVersion
? version2)
164
public static bool operator <(
SemanticVersion
version1,
SemanticVersion
version2)
172
public static bool operator <=(
SemanticVersion
version1,
SemanticVersion
version2)
180
public static bool operator >(
SemanticVersion
version1,
SemanticVersion
version2)
188
public static bool operator >=(
SemanticVersion
version1,
SemanticVersion
version2)
193
private static int Compare(
SemanticVersion
? version1,
SemanticVersion
? version2)
SemanticVersionConverter.cs (5)
11
/// Provides a type converter to convert <see cref="
SemanticVersion
"/> objects to and from various other representations.
17
/// <see cref="
SemanticVersion
"/> using the specified context.
45
return
SemanticVersion
.Parse(versionString);
63
/// Converts the given value object to a <see cref="
SemanticVersion
"/> object using the arguments.
78
if (destinationType == typeof(string) && value is
SemanticVersion
version)
SemanticVersionFactory.cs (3)
18
public static
SemanticVersion
Parse(string value)
20
if (!TryParse(value, out
SemanticVersion
? ver))
32
public static bool TryParse(string value, [NotNullWhen(true)] out
SemanticVersion
? version)
VersionComparer.cs (11)
54
public bool Equals(
SemanticVersion
? x,
SemanticVersion
? y)
88
public static int Compare(
SemanticVersion
? version1,
SemanticVersion
? version2, VersionComparison versionComparison)
100
public int GetHashCode(
SemanticVersion
version)
147
public int Compare(
SemanticVersion
? x,
SemanticVersion
? y)
360
private static string[]? GetReleaseLabelsOrNull(
SemanticVersion
version)
384
private static bool AreReleaseLabelsEqual(
SemanticVersion
x,
SemanticVersion
y)
424
private static int GetRevisionOrZero(
SemanticVersion
version)
VersionFormatter.cs (6)
35
if (arg is not
SemanticVersion
version)
62
|| typeof(
SemanticVersion
).IsAssignableFrom(formatType))
70
private static void Format(StringBuilder builder, char c,
SemanticVersion
version)
111
private static void AppendFull(StringBuilder builder,
SemanticVersion
version)
126
internal static void AppendNormalized(StringBuilder builder,
SemanticVersion
version)
137
private static void AppendVersion(StringBuilder builder,
SemanticVersion
version)
VersionRangeBase.cs (1)
340
private static bool? IsPrerelease(
SemanticVersion
? version)