/// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            foreach (string entityPath in Entities.EntityPaths) {
                arguments.Add(entityPath, null, PVCSCommandArgumentPosition.End);
            }
        }
Exemplo n.º 2
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (Revision != Double.MaxValue)
            {
                arguments.Add("-r", Revision);
            }

            string commandValue = null;

            switch (UnlockMode)
            {
            case PVCSUnlockMode.AllUsers:
                commandValue = "*";
                break;

            case PVCSUnlockMode.CurrentUser:
                break;

            case PVCSUnlockMode.SpecifiedUser:
                if (User == null)
                {
                    throw new BuildException("Must specify the user when unlockmode is set to SpecifiedUser.");
                }

                commandValue = User;
                break;

            default:
                throw new BuildException("Unknown PVCSUnlockMode: " + UnlockMode);
            }

            arguments.Add("-u", commandValue);
        }
Exemplo n.º 3
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (NoBranching)
            {
                arguments.Add("-nb");
            }

            if (NoMultilock)
            {
                arguments.Add("-nm");
            }

            if (PromotionGroup != null)
            {
                arguments.Add("-g", PromotionGroup);
            }

            if (Revision != Double.MaxValue)
            {
                arguments.Add("-r", Revision);
            }

            if (YesToBranching)
            {
                arguments.Add("-yb");
            }

            if (YesToMultilock)
            {
                arguments.Add("-ym");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructs the program arguments that should be used when executing the wrapped PVCS process.
        /// </summary>
        /// <returns>A <c>string</c> containing the program arguments.</returns>
        private string GetProgramArguments()
        {
            StringBuilder retVal = new StringBuilder();

            PVCSCommandArgumentCollection arguments = new PVCSCommandArgumentCollection();

            //no banner
            arguments.Add("-nb", null, PVCSCommandArgumentPosition.BeforePCLICommand);
            arguments.Add(PCLICommandName, null, PVCSCommandArgumentPosition.Start);

            //allow subclasses to add their task-specific arguments
            AddCommandLineArguments(arguments);

            PVCSCommandArgument[] argumentsArray = arguments.ToArray();
            Array.Sort(argumentsArray);

            for (int i = 0; i < argumentsArray.Length; ++i)
            {
                Log(Level.Debug, "{0}: {1}", i, argumentsArray[i]);

                if (i != 0)
                {
                    retVal.Append(" ");
                }

                retVal.Append(argumentsArray[i]);
            }

            return(retVal.ToString());
        }
Exemplo n.º 5
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (BaseProjectPath != null)
            {
                arguments.Add("-bp", BaseProjectPath);
            }

            if (Location != null)
            {
                arguments.Add("-a", Location);
            }

            if (Lock)
            {
                arguments.Add("-l");
            }

            if (MakeWritable)
            {
                arguments.Add("-w");
            }

            if (!MaxDateTime.Equals(DateTime.MaxValue))
            {
                arguments.Add("-d", MaxDateTime);
            }

            if (OverrideWorkfileLocation)
            {
                arguments.Add("-o");
            }

            if (PromotionGroup != null)
            {
                arguments.Add("-g", PromotionGroup);
            }

            if (Revision != Double.MaxValue)
            {
                arguments.Add("-r", Revision);
            }

            if (Touch)
            {
                arguments.Add("-t");
            }

            if (UpdateOnly)
            {
                arguments.Add("-u");
            }

            if (VersionLabel != null)
            {
                arguments.Add("-v", VersionLabel);
            }
        }
Exemplo n.º 6
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            foreach (string entityPath in Entities.EntityPaths)
            {
                arguments.Add(entityPath, null, PVCSCommandArgumentPosition.End);
            }
        }
Exemplo n.º 7
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (WorkfileLocation != null)
            {
                arguments.Add("-w", WorkfileLocation);
            }
        }
Exemplo n.º 8
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            arguments.Add("-t", ArchiveDescription);

            switch (CopyMode)
            {
            case PVCSCopyMode.Default:
                break;

            case PVCSCopyMode.CopyWorkfileIfRequired:
                arguments.Add("-c");
                break;

            case PVCSCopyMode.CopyWorkfileWithOverwrite:
                arguments.Add("-co");
                break;

            default:
                throw new BuildException("Unknown PVCSCopyMode: " + CopyMode);
            }

            if (DeleteWorkfiles)
            {
                arguments.Add("-d");
            }

            if (Description != null)
            {
                arguments.Add("-m", Description);
            }

            if (Lock)
            {
                arguments.Add("-l");
            }

            if (PromotionGroup != null)
            {
                arguments.Add("-g", PromotionGroup);
            }

            if (SuppressAddIfExists)
            {
                arguments.Add("-qw");
            }

            if (VersionLabel != null)
            {
                arguments.Add("-v", VersionLabel);
            }
        }
Exemplo n.º 9
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (ExpiryDate != DateTime.MaxValue)
            {
                arguments.Add("-e", ExpiryDate);
            }

            string userPassword = UserName;

            if (Password != null)
            {
                userPassword = userPassword + ":" + Password;
            }

            arguments.Add(userPassword, null, PVCSCommandArgumentPosition.End);
        }
Exemplo n.º 10
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (Floating)
            {
                arguments.Add("-f");
            }

            if (Revision != Double.MaxValue)
            {
                arguments.Add("-r", Revision);
            }

            if (VersionLabel != null)
            {
                arguments.Add("-v", VersionLabel);
            }
        }
Exemplo n.º 11
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            if (!SupportsIncludeSubprojects && _includeSubProjectsUsed)
            {
                throw new BuildException(string.Format("The {0} task does not support the includesubprojects attribute.", base.Name));
            }

            if (IncludeSubprojects)
            {
                arguments.Add("-z");
            }

            if (ProjectDatabase != null)
            {
                arguments.Add("-pr", ProjectDatabase);
            }

            if (ProjectPath != null)
            {
                arguments.Add("-pp", ProjectPath);
            }

            if (UserId != null)
            {
                string commandValue = null;

                if (Password == null)
                {
                    commandValue = UserId;
                }
                else
                {
                    commandValue = string.Format("{0}:{1}", UserId, Password);
                }

                arguments.Add("-id", commandValue);
            }

            if (Workspace != null)
            {
                arguments.Add("-sp", Workspace);
            }
        }
Exemplo n.º 12
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            object revisionArgument        = null;
            bool   promotionGroupSpecified = (PromotionGroup != null);
            bool   revisionSpecified       = (Revision != Double.MaxValue);
            bool   versionLabelSpecified   = (VersionLabel != null);
            int    count = 0;

            if (promotionGroupSpecified)
            {
                ++count;
                revisionArgument = PromotionGroup;
            }

            if (revisionSpecified)
            {
                ++count;
                revisionArgument = Revision;
            }

            if (versionLabelSpecified)
            {
                ++count;
                revisionArgument = VersionLabel;
            }

            if (count != 1)
            {
                throw new BuildException("Must specify one of promotiongroup, revision or versionlabel for the pvcsassigngroup task.");
            }

            arguments.Add("-g", AssignPromotionGroup);
            arguments.Add("-r", revisionArgument);
        }
Exemplo n.º 13
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            if (NoBranching) {
                arguments.Add("-nb");
            }

            if (NoMultilock) {
                arguments.Add("-nm");
            }

            if (PromotionGroup != null) {
                arguments.Add("-g", PromotionGroup);
            }

            if (Revision != Double.MaxValue) {
                arguments.Add("-r", Revision);
            }

            if (YesToBranching) {
                arguments.Add("-yb");
            }

            if (YesToMultilock) {
                arguments.Add("-ym");
            }
        }
Exemplo n.º 14
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
 {
     base.AddCommandLineArguments(arguments);
     arguments.Add(AcrossBranches ? "-yb" : "-nb");
     arguments.Add("-g", PromotionGroup);
 }
Exemplo n.º 15
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
 {
     base.AddCommandLineArguments(arguments);
     arguments.Add("-g", PromotionGroup);
 }
Exemplo n.º 16
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            if (BaseProjectPath != null) {
                arguments.Add("-bp", BaseProjectPath);
            }

            if (Location != null) {
                arguments.Add("-a", Location);
            }

            if (Lock) {
                arguments.Add("-l");
            }

            if (MakeWritable) {
                arguments.Add("-w");
            }

            if (!MaxDateTime.Equals(DateTime.MaxValue)) {
                arguments.Add("-d", MaxDateTime);
            }

            if (OverrideWorkfileLocation) {
                arguments.Add("-o");
            }

            if (PromotionGroup != null) {
                arguments.Add("-g", PromotionGroup);
            }

            if (Revision != Double.MaxValue) {
                arguments.Add("-r", Revision);
            }

            if (Touch) {
                arguments.Add("-t");
            }

            if (UpdateOnly) {
                arguments.Add("-u");
            }

            if (VersionLabel != null) {
                arguments.Add("-v", VersionLabel);
            }
        }
Exemplo n.º 17
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            if (BaseProjectPath != null) {
                arguments.Add("-bp", BaseProjectPath);
            }

            if (CheckInUnchanged) {
                arguments.Add("-yf");
            }

            if (Description != null) {
                arguments.Add("-m", Description);
            }

            if (FloatLabel) {
                arguments.Add("-fv");
            }

            if (ForceBranch) {
                arguments.Add("-fb");
            }

            if (IgnoreSpaces) {
                arguments.Add("-b");
            }

            if (KeepWorkfile) {
                arguments.Add("-k");
            }

            if (Location != null) {
                arguments.Add("-a", Location);
            }

            if (Lock) {
                arguments.Add("-l");
            }

            if (OverrideWorkfileLocation) {
                arguments.Add("-o");
            }

            if (PromotionGroup != null) {
                arguments.Add("-g", PromotionGroup);
            }

            if (ReassignLabelIfExists) {
                arguments.Add("-yv");
            }

            if (Revision != Double.MaxValue) {
                arguments.Add("-r", Revision);
            }

            if (UseSameDescription) {
                arguments.Add("-ym");
            }

            if (VersionLabel != null) {
                arguments.Add("-v", VersionLabel);
            }
        }
Exemplo n.º 18
0
 /// <summary>
 /// Allows tasks to add their task-specific arguments to the collection of arguments to be passed to the
 /// PVCS command-line tool.
 /// </summary>
 /// <param name="arguments">The collection of arguments.</param>
 protected abstract void AddCommandLineArguments(PVCSCommandArgumentCollection arguments);
Exemplo n.º 19
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
     base.AddCommandLineArguments(arguments);
     arguments.Add("-vf", From);
     arguments.Add("-vt", To);
 }
Exemplo n.º 20
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
     base.AddCommandLineArguments(arguments);
     arguments.Add("-g", PromotionGroup);
 }
Exemplo n.º 21
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            arguments.Add("-t", ArchiveDescription);

            switch (CopyMode) {
                case PVCSCopyMode.Default:
                    break;
                case PVCSCopyMode.CopyWorkfileIfRequired:
                    arguments.Add("-c");
                    break;
                case PVCSCopyMode.CopyWorkfileWithOverwrite:
                    arguments.Add("-co");
                    break;
                default:
                    throw new BuildException("Unknown PVCSCopyMode: " + CopyMode);
            }

            if (DeleteWorkfiles) {
                arguments.Add("-d");
            }

            if (Description != null) {
                arguments.Add("-m", Description);
            }

            if (Lock) {
                arguments.Add("-l");
            }

            if (PromotionGroup != null) {
                arguments.Add("-g", PromotionGroup);
            }

            if (SuppressAddIfExists) {
                arguments.Add("-qw");
            }

            if (VersionLabel != null) {
                arguments.Add("-v", VersionLabel);
            }

        }
Exemplo n.º 22
0
 /// <summary>
 /// Allows tasks to add their task-specific arguments to the collection of arguments to be passed to the
 /// PVCS command-line tool.
 /// </summary>
 /// <param name="arguments">The collection of arguments.</param>
 protected abstract void AddCommandLineArguments(PVCSCommandArgumentCollection arguments);
Exemplo n.º 23
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            if (ExpiryDate != DateTime.MaxValue) {
                arguments.Add("-e", ExpiryDate);
            }

            string userPassword = UserName;

            if (Password != null) {
                userPassword = userPassword + ":" + Password;
            }

            arguments.Add(userPassword, null, PVCSCommandArgumentPosition.End);
        }
Exemplo n.º 24
0
        /// <summary>
        /// Constructs the program arguments that should be used when executing the wrapped PVCS process.
        /// </summary>
        /// <returns>A <c>string</c> containing the program arguments.</returns>
        private string GetProgramArguments() {
            StringBuilder retVal = new StringBuilder();

            PVCSCommandArgumentCollection arguments = new PVCSCommandArgumentCollection();
            //no banner
            arguments.Add("-nb", null, PVCSCommandArgumentPosition.BeforePCLICommand);
            arguments.Add(PCLICommandName, null, PVCSCommandArgumentPosition.Start);

            //allow subclasses to add their task-specific arguments
            AddCommandLineArguments(arguments);

            PVCSCommandArgument[] argumentsArray = arguments.ToArray();
            Array.Sort(argumentsArray);

            for (int i = 0; i < argumentsArray.Length; ++i) {
                Log(Level.Debug, "{0}: {1}", i, argumentsArray[i]);

                if (i != 0) {
                    retVal.Append(" ");
                }

                retVal.Append(argumentsArray[i]);
            }

            return retVal.ToString();
        }
Exemplo n.º 25
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
     base.AddCommandLineArguments(arguments);
     arguments.Add(AcrossBranches ? "-yb" : "-nb");
     arguments.Add("-g", PromotionGroup);
 }
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            if (!SupportsIncludeSubprojects && _includeSubProjectsUsed) {
                throw new BuildException(string.Format("The {0} task does not support the includesubprojects attribute.", base.Name));
            }

            if (IncludeSubprojects) {
                arguments.Add("-z");
            }

            if (ProjectDatabase != null) {
                arguments.Add("-pr", ProjectDatabase);
            }

            if (ProjectPath != null) {
                arguments.Add("-pp", ProjectPath);
            }

            if (UserId != null) {
                string commandValue = null;

                if (Password == null) {
                    commandValue = UserId;
                } else {
                    commandValue = string.Format("{0}:{1}", UserId, Password);
                }

                arguments.Add("-id", commandValue);
            }

            if (Workspace != null) {
                arguments.Add("-sp", Workspace);
            }
        }
Exemplo n.º 27
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
 {
     base.AddCommandLineArguments(arguments);
     arguments.Add("-v", VersionLabel);
 }
Exemplo n.º 28
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
 {
     base.AddCommandLineArguments(arguments);
     arguments.Add(Entity, null, PVCSCommandArgumentPosition.End);
 }
Exemplo n.º 29
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            if (WorkfileLocation != null) {
                arguments.Add("-w", WorkfileLocation);
            }
        }
Exemplo n.º 30
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
     base.AddCommandLineArguments(arguments);
     arguments.Add("-gf", From);
     arguments.Add("-gt", To);
 }
Exemplo n.º 31
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments)
        {
            base.AddCommandLineArguments(arguments);

            if (BaseProjectPath != null)
            {
                arguments.Add("-bp", BaseProjectPath);
            }

            if (CheckInUnchanged)
            {
                arguments.Add("-yf");
            }

            if (Description != null)
            {
                arguments.Add("-m", Description);
            }

            if (FloatLabel)
            {
                arguments.Add("-fv");
            }

            if (ForceBranch)
            {
                arguments.Add("-fb");
            }

            if (IgnoreSpaces)
            {
                arguments.Add("-b");
            }

            if (KeepWorkfile)
            {
                arguments.Add("-k");
            }

            if (Location != null)
            {
                arguments.Add("-a", Location);
            }

            if (Lock)
            {
                arguments.Add("-l");
            }

            if (OverrideWorkfileLocation)
            {
                arguments.Add("-o");
            }

            if (PromotionGroup != null)
            {
                arguments.Add("-g", PromotionGroup);
            }

            if (ReassignLabelIfExists)
            {
                arguments.Add("-yv");
            }

            if (Revision != Double.MaxValue)
            {
                arguments.Add("-r", Revision);
            }

            if (UseSameDescription)
            {
                arguments.Add("-ym");
            }

            if (VersionLabel != null)
            {
                arguments.Add("-v", VersionLabel);
            }
        }
Exemplo n.º 32
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            if (Floating) {
                arguments.Add("-f");
            }

            if (Revision != Double.MaxValue) {
                arguments.Add("-r", Revision);
            }

            if (VersionLabel != null) {
                arguments.Add("-v", VersionLabel);
            }
        }
Exemplo n.º 33
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
     base.AddCommandLineArguments(arguments);
     arguments.Add("-v", VersionLabel);
 }
Exemplo n.º 34
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            if (Revision != Double.MaxValue) {
                arguments.Add("-r", Revision);
            }

            string commandValue = null;

            switch (UnlockMode) {
                case PVCSUnlockMode.AllUsers:
                    commandValue = "*";
                    break;
                case PVCSUnlockMode.CurrentUser:
                    break;
                case PVCSUnlockMode.SpecifiedUser:
                    if (User == null) {
                        throw new BuildException("Must specify the user when unlockmode is set to SpecifiedUser.");
                    }

                    commandValue = User;
                    break;
                default:
                    throw new BuildException("Unknown PVCSUnlockMode: " + UnlockMode);
            }

            arguments.Add("-u", commandValue);
        }
Exemplo n.º 35
0
        /// <see cref="PVCSTask.AddCommandLineArguments"/>
        protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
            base.AddCommandLineArguments(arguments);

            object revisionArgument = null;
            bool promotionGroupSpecified = (PromotionGroup != null);
            bool revisionSpecified = (Revision != Double.MaxValue);
            bool versionLabelSpecified = (VersionLabel != null);
            int count = 0;

            if (promotionGroupSpecified) {
                ++count;
                revisionArgument = PromotionGroup;
            }

            if (revisionSpecified) {
                ++count;
                revisionArgument = Revision;
            }

            if (versionLabelSpecified) {
                ++count;
                revisionArgument = VersionLabel;
            }

            if (count != 1) {
                throw new BuildException("Must specify one of promotiongroup, revision or versionlabel for the pvcsassigngroup task.");
            }

            arguments.Add("-g", AssignPromotionGroup);
            arguments.Add("-r", revisionArgument);
        }
Exemplo n.º 36
0
 /// <see cref="PVCSTask.AddCommandLineArguments"/>
 protected override void AddCommandLineArguments(PVCSCommandArgumentCollection arguments) {
     base.AddCommandLineArguments(arguments);
     arguments.Add(Entity, null, PVCSCommandArgumentPosition.End);
 }