Service class for logging referenced packages.
예제 #1
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");
		}
예제 #2
0
		private void SetupProjectUrl(LogPackage package)
		{
			if (!package.IsLocal)
			{
				package.ProjectUrl = $"https://www.nuget.org/packages/{package.PackageId}/";
				return;
			}

			if (package.IsStatic)
			{
				package.ProjectUrl = $"https://rufc-devbuild.cneu.cnwk/nuget/packages/{package.PackageId}/";
				return;
			}

			package.ProjectUrl = $"http://rufc-devbuild.cneu.cnwk/ccnet/server/Library/project/{package.ProjectName}/ViewProjectReport.aspx";
		}