Example #1
0
        private PackageInfo GetOrCreatePackageInfo(PackageIndex index, string id)
        {
            PackageInfo info;

            if (!index.Packages.TryGetValue(id, out info))
            {
                index.Packages[id] = info = new PackageInfo();
            }

            return info;
        }
Example #2
0
        public void Merge(PackageInfo other)
        {
            StableVersions.UnionWith(other.StableVersions);

            if (other.BaselineVersion != null)
            {
                // prefer other over existing
                BaselineVersion = other.BaselineVersion;
            }

            if (other.PreRelease != null)
            {
                PreRelease = other.PreRelease;
            }

            foreach (var assemblyVersionInPackage in other.AssemblyVersionInPackageVersion)
            {
                Version otherAssemblyVersion = assemblyVersionInPackage.Key;
                Version otherPackageVersion = assemblyVersionInPackage.Value;

                AddAssemblyVersionInPackage(otherAssemblyVersion, otherPackageVersion);
            }
        }