CCNet.Build.SetupPackages.PackagesHelper.UpdatePackageVersions C# (CSharp) Method

UpdatePackageVersions() private method

private UpdatePackageVersions ( PackagesConfig config ) : void
config PackagesConfig
return void
		private void UpdatePackageVersions(PackagesConfig config)
		{
			Console.Write("Updating package versions... ");

			foreach (var element in config.AllPackages())
			{
				var package = element.AsPackage();

				// skip remote packages
				if (!m_checker.IsLocal(package.Id))
					continue;

				// skip static packages
				if (m_checker.IsStatic(package.Id))
					continue;

				// package should be pinned to its current version
				if (m_checker.IsPinnedToCurrentVersion(package.Id))
					continue;

				// get version to use for local package
				var versionToUse = m_checker.VersionToUse(package.Id);

				// update is not required
				if (versionToUse.Normalize() == package.Version.Normalize())
					continue;

				// update package version within packages configuration
				element.Attribute("version").Value = versionToUse.ToString();
			}

			Console.WriteLine("OK");
		}
	}