public static Parse ( string value, bool preserveMissingComponents = false ) : |
||
value | string | |
preserveMissingComponents | bool | |
Résultat |
public void Default(string packageVersion) { try { SemanticVersion.Parse(packageVersion); defaultVersion = packageVersion; } catch (ArgumentException) { if (packageVersion.Contains(":")) { throw new ArgumentException("Invalid package version format. Use the package parameter if you need to specify the step name and version."); } throw; } }
public void Add(string stepNameOrPackageId, string packageReferenceName, string packageVersion) { // Double wild card == default value if (stepNameOrPackageId == WildCard && packageReferenceName == WildCard) { Default(packageVersion); return; } var key = new PackageKey(stepNameOrPackageId, packageReferenceName ?? WildCard); if (stepNameToVersion.TryGetValue(key, out var current)) { var newVersion = SemanticVersion.Parse(packageVersion); var currentVersion = SemanticVersion.Parse(current); if (newVersion < currentVersion) { return; } } stepNameToVersion[key] = packageVersion; }