public bool Process(ILogger logger, IEnumerable<string> args, MetaProjectPersistence metaProject, ComponentsList components, string packagesOutputDirectory)
		{
			var nugetNamePattern = args.FirstOrDefault();
			if (nugetNamePattern == null || nugetNamePattern.StartsWith("-") || nugetNamePattern.EndsWith("\"")) {
				logger.Error("No nuget pattern specified");
				return true;
			}
			var nugetComponent = components.FindComponent<INugetSpec>(nugetNamePattern);
			if (nugetComponent == null)
				return true;
			logger.Info("== Nuget to add: {0}", nugetComponent);
			var componentNamePattern = args.LastOrDefault();
			if (componentNamePattern == null || componentNamePattern.StartsWith("-") || componentNamePattern.EndsWith("\"")) {
				logger.Error("No component pattern specified");
				return true;
			}
			var specificComponent = components.FindComponent<IProject>(componentNamePattern);
			if (specificComponent == null)
				return true;
			logger.Info("== Component to reference nuget: {0}", specificComponent);
			if (specificComponent == nugetComponent) {
				logger.Error("Nuget can't be added to itself");
				return true;
			}
			specificComponent.AddNuget(logger, nugetComponent, components, packagesOutputDirectory);
			return true;
		}
		public bool Process(ILogger logger, IEnumerable<string> args, MetaProjectPersistence metaProject, ComponentsList components, string packagesOutputDirectory)
		{
			// BIG TODO: reengineer command parsing
			var componentNamePattern = args.LastOrDefault();
			if (componentNamePattern == null || componentNamePattern.StartsWith("-") || componentNamePattern.EndsWith("\"")) {
				logger.Error("No component pattern specified");
				return true;
			}
			string tags = args.ParseStringParameter("tags");
			string licenseUrl = args.ParseStringParameter("licenseUrl");
			string projectUrl = args.ParseStringParameter("projectUrl");
			string iconUrl = args.ParseStringParameter("iconUrl");
			string copyright = args.ParseStringParameter("copyright");
			bool requireLicenseAcceptance = args.Contains("-r");
			if (licenseUrl == null && requireLicenseAcceptance) {
				logger.Error("Requiring license acceptance demands a license url");
				return true;
			}
			var specificComponent = components.FindComponent<IProject>(componentNamePattern, c => c.CanBecomeNugget);
			if (specificComponent == null)
				return true;
			if (specificComponent.PromoteToNuget(logger, packagesOutputDirectory, tags,
				licenseUrl, projectUrl, iconUrl, copyright, requireLicenseAcceptance) != null)
				ScanCommand.Rescan(logger, metaProject, components);
			return true;
		}
Beispiel #3
0
		public bool Process(ILogger logger, IEnumerable<string> args, MetaProjectPersistence metaProject, ComponentsList components, string packagesOutputDirectory)
		{
			UpdatePackagesCommand.UpdateDependencies(logger, components, packagesOutputDirectory);
			var componentNamePattern = args.FirstOrDefault(s => !s.StartsWith("-"));
			if (!string.IsNullOrWhiteSpace(componentNamePattern)) {
				var rootComponent = components.FindComponent<IVersionable>(componentNamePattern);
				if (rootComponent == null)
					return true;
				BuildHelper.BuildChain(logger, rootComponent, packagesOutputDirectory, rootComponent.DependentProjects);
			} else {
				foreach (var rootComponent in GetPendingForPublishingComponents(logger, components, packagesOutputDirectory))
					BuildHelper.BuildChain(logger, rootComponent, packagesOutputDirectory, rootComponent.DependentProjects);
			}
			return true;
		}
		public bool Process(ILogger logger, IEnumerable<string> args, MetaProjectPersistence metaProject, ComponentsList components, string packagesOutputDirectory)
		{
			bool foundOne = false;
			var partToBump = ParsePartToBump(logger, args);
			bool noBuild = args.Where(s => s.StartsWith("-n")).Count() > 0;
			foreach (var componentNamePattern in args.Where(s => !s.StartsWith("-"))) {
				foundOne = true;
				var specificComponent = components.FindComponent<IVersionable>(componentNamePattern);
				if (specificComponent == null)
					return true;
				BumpVersion(logger, specificComponent, partToBump, packagesOutputDirectory, noBuild);
			}
			if (!foundOne) {
				logger.Error("No component pattern specified");
				return true;
			}
			return true;
		}