public bool IsCompatibleWith(SemanticVersion other) { if (other == null) throw new ArgumentNullException("other"); var comparisonResult = this.CompareTo(other); return comparisonResult <= 0; }
public ManifestModuleInfo(ModuleManifest manifest) : base(manifest.Id, manifest.ModuleType, (manifest.Dependencies ?? new ManifestDependency[0]).Select(d => d.Id).ToArray()) { Id = manifest.Id; Version = new SemanticVersion(new System.Version(manifest.Version)); PlatformVersion = new SemanticVersion(new System.Version(manifest.PlatformVersion)); Title = manifest.Title; Description = manifest.Description; Authors = manifest.Authors; Owners = manifest.Owners; LicenseUrl = manifest.LicenseUrl; ProjectUrl = manifest.ProjectUrl; IconUrl = manifest.IconUrl; RequireLicenseAcceptance = manifest.RequireLicenseAcceptance; ReleaseNotes = manifest.ReleaseNotes; Copyright = manifest.Copyright; Tags = manifest.Tags; UseFullTypeNameInSwagger = manifest.UseFullTypeNameInSwagger; Ref = manifest.PackageUrl; Identity = new ModuleIdentity(Id, Version); Errors = new List<string>(); Dependencies = new List<ModuleIdentity>(); if (manifest.Dependencies != null) { Dependencies.AddRange(manifest.Dependencies.Select(x => new ModuleIdentity(x.Id, x.Version))); } Styles = new List<ManifestBundleItem>(); if (manifest.Styles != null) { Styles.AddRange(manifest.Styles); } Scripts = new List<ManifestBundleItem>(); if (manifest.Scripts != null) { Scripts.AddRange(manifest.Scripts); } Permissions = new List<ModulePermissionGroup>(); if (manifest.Permissions != null) { Permissions.AddRange(manifest.Permissions); } Settings = new List<ModuleSettingsGroup>(); if (manifest.Settings != null) { Settings.AddRange(manifest.Settings); } Groups = new List<string>(); if (manifest.Groups != null) { Groups.AddRange(manifest.Groups); } InitializationMode = InitializationMode.OnDemand; }
public ModuleIdentity(string id, SemanticVersion version) { Id = id; Version = version; }
public bool IsCompatibleWithBySemVer(SemanticVersion other) { if (other == null) throw new ArgumentNullException("other"); //MAJOR version when you make incompatible API changes, var retVal = Major == other.Major; if (retVal) { //MINOR version when you add functionality in a backwards-compatible manner retVal = Minor <= other.Minor; } return retVal; }