private void AnalyzePackages(PackagesConfig config)
        {
            Console.Write("Analyzing packages... ");

            foreach (var package in config.AllPackages().Select(e => e.AsPackage()))
            {
                var log = new LogPackage
                {
                    PackageId        = package.Id,
                    ProjectName      = m_checker.ProjectName(package.Id),
                    IsLocal          = m_checker.IsLocal(package.Id),
                    IsStatic         = m_checker.IsStatic(package.Id),
                    SourceVersion    = package.Version,
                    PinnedToCurrent  = m_checker.IsPinnedToCurrentVersion(package.Id),
                    PinnedToSpecific = m_checker.IsPinnedToSpecificVersion(package.Id),
                    IsDependency     = m_checker.IsDependency(package.Id),
                    IsBundle         = m_checker.IsBundle(package.Id)
                };

                SetupProjectUrl(log);

                m_log.Add(package.Id, log);
            }

            Console.WriteLine("OK");
        }
Ejemplo n.º 2
0
		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");
		}
Ejemplo n.º 3
0
		private void AnalyzePackages(PackagesConfig config)
		{
			Console.Write("Analyzing packages... ");

			foreach (var package in config.AllPackages().Select(e => e.AsPackage()))
			{
				var log = new LogPackage
				{
					PackageId = package.Id,
					ProjectName = m_checker.ProjectName(package.Id),
					IsLocal = m_checker.IsLocal(package.Id),
					IsStatic = m_checker.IsStatic(package.Id),
					SourceVersion = package.Version,
					PinnedToCurrent = m_checker.IsPinnedToCurrentVersion(package.Id),
					PinnedToSpecific = m_checker.IsPinnedToSpecificVersion(package.Id),
					IsDependency = m_checker.IsDependency(package.Id),
					IsBundle = m_checker.IsBundle(package.Id)
				};

				SetupProjectUrl(log);

				m_log.Add(package.Id, log);
			}

			Console.WriteLine("OK");
		}
Ejemplo n.º 4
0
		public void UpdateAll()
		{
			if (!File.Exists(Paths.PackagesConfig))
				return;

			Console.WriteLine("Update remote packages...");

			var config = new PackagesConfig(Paths.PackagesConfig);
			foreach (var package in config.AllPackages().Select(e => e.AsPackage()))
			{
				// skip local packages
				if (m_checker.IsLocal(package.Id))
					continue;

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

				// try to update remote package
				UpdatePackage(package.Id);
			}

			// update build versions for updated packages
			config = new PackagesConfig(Paths.PackagesConfig);
			foreach (var package in config.AllPackages().Select(e => e.AsPackage()))
			{
				m_log[package.Id].BuildVersion = package.Version;
			}
		}
Ejemplo n.º 5
0
		public void Adjust()
		{
			if (!File.Exists(Paths.PackagesConfig))
				return;

			var config = new PackagesConfig(Paths.PackagesConfig);

			AnalyzePackages(config);
			UpdatePackageVersions(config);

			config.Save();
		}
        public void Adjust()
        {
            if (!File.Exists(Paths.PackagesConfig))
            {
                return;
            }

            var config = new PackagesConfig(Paths.PackagesConfig);

            AnalyzePackages(config);
            UpdatePackageVersions(config);

            config.Save();
        }
        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");
        }
Ejemplo n.º 8
0
        public void UpdateAll()
        {
            if (!File.Exists(Paths.PackagesConfig))
            {
                return;
            }

            Console.WriteLine("Update remote packages...");

            var config = new PackagesConfig(Paths.PackagesConfig);

            foreach (var package in config.AllPackages().Select(e => e.AsPackage()))
            {
                // skip local packages
                if (m_checker.IsLocal(package.Id))
                {
                    continue;
                }

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

                // try to update remote package
                UpdatePackage(package.Id);
            }

            // update build versions for updated packages
            config = new PackagesConfig(Paths.PackagesConfig);
            foreach (var package in config.AllPackages().Select(e => e.AsPackage()))
            {
                m_log[package.Id].BuildVersion = package.Version;
            }
        }