public static int?CompareTierVersionToToolVersion(VersionInfo tierVersion, VersionInfo toolVersion) => (tierVersion.IsPreRelease() || toolVersion.IsPreRelease()) // for pre-releases, we need the entire version information to determine ordering of versions ? tierVersion.CompareToVersion(toolVersion) // for stable releases, we only need the major version : tierVersion.GetMajorOnlyVersion().CompareToVersion(toolVersion.GetMajorOnlyVersion());
//--- Class Methods --- public static bool IsTierVersionCompatibleWithToolVersion(VersionInfo tierVersion, VersionInfo toolVersion) => toolVersion.IsPreRelease() // allow a tool pre-release, next version to be compatible with any previously deployed tier version ? tierVersion.GetMajorOnlyVersion().WithoutSuffix().IsEqualToVersion(toolVersion.GetMajorOnlyVersion().WithoutSuffix()) && tierVersion.IsLessOrEqualThanVersion(toolVersion) // tool major version must match tier major version : tierVersion.GetMajorOnlyVersion().IsEqualToVersion(toolVersion.GetMajorOnlyVersion());
public static string GetLambdaSharpAssemblyWildcardVersion(VersionInfo toolVersion, string framework) { if (toolVersion.IsPreRelease()) { // NOTE (2018-12-16, bjorg): for pre-release version, there is no wildcard; the version must match everything return(toolVersion.ToString()); } return($"{GetLambdaSharpAssemblyReferenceVersion(toolVersion)}.*"); }
public static bool IsModuleCoreVersionCompatibleWithToolVersion(VersionInfo moduleCoreVersion, VersionInfo toolVersion) => toolVersion.IsPreRelease() ? moduleCoreVersion.GetMajorOnlyVersion().WithoutSuffix().IsEqualToVersion(toolVersion.GetMajorOnlyVersion().WithoutSuffix()) && moduleCoreVersion.IsLessOrEqualThanVersion(toolVersion) : moduleCoreVersion.GetMajorOnlyVersion().IsEqualToVersion(toolVersion.GetMajorOnlyVersion());