public void TestMethod1()
        {
            var executeSetting = new ExecuteSetting("./");
            executeSetting.ForWidnow();
            var commandSet = new CommandSet(executeSetting);

            commandSet.Svn("svn_sample")
                .Url("http://svn.address.com/trunk")
                .Auth("username", "password")
                .Tags("tag1", "tab2")
                .WorkingCopy("workongfolder")
                .Tags("tag1", "tag2");

            var manager = new SettingManager();
            manager.Save(commandSet, "svn.ini", true);

            Assert.IsTrue(File.Exists("svn.ini"));

            var target = new CommandSet(new ExecuteSetting("./"));
            manager.ReadSetting(target, "svn.ini");

            var setting = (SvnSetting)target.Settings.First();

            Assert.AreEqual("http://svn.address.com/trunk", setting.Url);
            Assert.AreEqual("username", setting.UserName);
            Assert.AreEqual("password", setting.Password);
            Assert.AreEqual("tag1,tag2", String.Join(",", setting.Tags));
            Assert.AreEqual("workongfolder", setting.WorkingCopy);
            Assert.AreEqual("svn_sample", setting.Id);
        }
        public override bool Handle(CommandSet commandSet, string fileName, string argument)
        {
            commandSet.Svn("svn_sample")
                .Url("http://svn.address.com/trunk")
                .Auth("username", "password")
                .Tags("tag1","tab2")
                .WorkingCopy("workongfolder")
                .Tags("tag1", "tag2")
                ;

            commandSet
                .Build(true, "compileSample")
                .Dependency("svn_sample")
                .Tags("tag2", "tab3")
                .Release()
                .ProjectPath("/mypathfor.csproj")
                .CopyTo("publish/%prjName%");

            commandSet
                .CopyTo("publishFolder_or_network_path", "copySample")
                .Auth("networkPath_username", "networkPath_password")
                 .Dependency("compileSample")
                .Tags("tag4", "tab5")
                ;

            var manager = new SettingManager();
            manager.Save(commandSet, fileName, true);
            return false;
        }
Exemple #3
0
        private static void Run(CommandSet commandSet, FileInfo fullName)
        {
            try
            {
                if (!fullName.Exists)
                {
                    Console.WriteLine(fullName.Name + " not found.");
                    return;
                }
                var manager = new SettingManager();
                ExistFile = manager.ReadSetting(commandSet, fullName.FullName);
                commandSet.OnCommandSettingChanged += commandSet_OnCommandSettingChanged;
                commandSet.Invoke();
            }

            catch (AggregateException aggregateException)
            {
                foreach (CommandRunningException ex in aggregateException.InnerExceptions)
                {
                    Console.WriteLine(ex.Message);
                    Console.WriteLine(ex.ComandId);
                    Console.WriteLine(ex.Command + " " + ex.Arguments);
                }
            }
        }
Exemple #4
0
 private static void commandSet_OnCommandSettingChanged(object sender, EventArgs e)
 {
     var manager = new SettingManager();
     manager.Save(ExistFile, (CommandSet) sender, _fileInfo.FullName);
 }