Пример #1
0
        public static void UpdateSVNProject()
        {
            string configPath = "Assets/Temp/RayToolkit/Editor/ForSoarDragon/ProjectUpdate/SVNUpdatePaths.asset";
            var    config     = LoadProcessor.LoadConfigFile <StringDataSet>(configPath);
            string command    = "echo 开始";

            foreach (var item in config.content)
            {
                //更新SVN的命令
                command += " && " + CommandCreator.CreateCmdSVNProjectUpdateCommand(item, false);
            }
            UnityEngine.Debug.Log("更新所执行的命令如下:\n" + command);

            //执行cmd命令
            CommandProcessor.ExecuteCmdExe(command);
        }
Пример #2
0
        public static string GetUpdateCmdArgumentsByConfigFile(string configFilePath)
        {
            ProjectUpdateData config = LoadProcessor.LoadConfigFile <ProjectUpdateData>(configFilePath);

            string command = "echo 开始";

            foreach (var item in config.updateSetting)
            {
                //更新SVN的命令
                command += " && " + CommandCreator.CreateCmdSVNProjectUpdateCommand(item.svnFilePath);

                //拷贝指定的文件的命令
                int           filesCount      = item.fileName.Count;
                List <string> sourceFilesPath = new List <string>();
                List <string> desFilesPath    = new List <string>();
                for (int i = 0; i < filesCount; i++)
                {
                    sourceFilesPath.Add(item.svnFilePath + "\\" + item.fileName[i]);
                    desFilesPath.Add(item.gitFilePath + "\\" + item.fileName[i]);
                }
                command += " && " + CommandCreator.CreateCmdCopyFilesCommand(sourceFilesPath.ToArray(), desFilesPath.ToArray());

                //cmd切换目录到Git项目的目录
                command += " && " + CommandCreator.CreateCmdSwitchDirCommand(item.gitFilePath);

                //Git Pull的命令
                command += " && " + CommandCreator.CreateCmdGitPullCommand();

                //暂存文件到Git的命令
                command += " && " + CommandCreator.CreateCmdGitAddSpecifyFilesCommand(desFilesPath.ToArray());

                //提交文件到Git的命令
                if (item.autoCommit)
                {
                    command += " && " + CommandCreator.CreateCmdGitCommitSpecifyFilesCommand(desFilesPath.ToArray(), item.commitComment);
                }
            }

            //推送Git的命令
            if (config.autoPush)
            {
                command += " && " + CommandCreator.CreateCmdGitPushCommand();
            }

            return(command);
        }