RunProcess() public static method

public static RunProcess ( string file, string args, string workingDir ) : string
file string
args string
workingDir string
return string
Exemplo n.º 1
0
        public void GenerateBuildInfo(string targetDir)
        {
            string head = SystemUtil.RunProcess(SystemUtil.GitExe, "rev-parse HEAD", MonoDevelopPath).Trim();

            var txt = "Release ID: " + ReleaseId + "\n";

            txt += "Git revision: " + head + "\n";
            txt += "Build date: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:sszz") + "\n";

            File.WriteAllText(Path.Combine(targetDir, "buildinfo"), txt);
        }
Exemplo n.º 2
0
        static int GetVersionCommitDistance(string path)
        {
            var    blame = new StringReader(SystemUtil.RunProcess(SystemUtil.GitExe, "blame version.config", path));
            string line;

            while ((line = blame.ReadLine()) != null && line.IndexOf("Version=") == -1)
            {
                ;
            }
            if (line != null)
            {
                string hash = line.Substring(0, line.IndexOf(' ')).TrimStart('^');
                string dist = SystemUtil.RunProcess(SystemUtil.GitExe, "rev-list --count " + hash + "..HEAD", path);
                return(int.Parse(dist.Trim()));
            }
            return(0);
        }
Exemplo n.º 3
0
        public void GenerateBuildInfo(string targetDir)
        {
            string head = SystemUtil.RunProcess(SystemUtil.GitExe, "rev-parse HEAD", MonoDevelopPath).Trim();

            var txt = "Release ID: " + ReleaseId + "\n";

            txt += "Git revision: " + head + "\n";
            txt += "Build date: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:sszz") + "\n";

            var buildBranch = Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCHNAME");

            if (!string.IsNullOrWhiteSpace(buildBranch))
            {
                txt += "Build branch: " + buildBranch;
            }

            File.WriteAllText(Path.Combine(targetDir, "buildinfo"), txt);
        }