예제 #1
0
        private void CleanUpXcodeOutput(ezProcessHelper.ProcessResult processRes)
        {
            if (processRes == null || String.IsNullOrEmpty(processRes.StdOut))
            {
                return;
            }

            List <string> newLines = new List <string>();

            string[] lines      = processRes.StdOut.Split('\n');
            int      iLineCount = lines.Count();

            for (int i = 0; i < iLineCount;)
            {
                // Skip the mega verbose output of CompileC.
                if ((i + 3 < iLineCount) &&
                    lines[i + 0].StartsWith("CompileC") &&
                    lines[i + 1].StartsWith("    cd") &&
                    lines[i + 2].StartsWith("    ") &&
                    lines[i + 3].StartsWith("    /"))
                {
                    newLines.Add(lines[i]);
                    i = i + 4;
                }
                else
                {
                    newLines.Add(lines[i]);
                    i++;
                }
            }

            string newStdOut = string.Join("\n", newLines);

            processRes.StdOut = newStdOut;
        }
예제 #2
0
        public bool CleanSolution(string sAbsWorkingDir)
        {
            if (!WriteBatFileCleanSolution(sAbsWorkingDir))
            {
                return(false);
            }

            ezProcessHelper.ProcessResult res = ezProcessHelper.RunExternalExe("cmd", "/c build.bat", sAbsWorkingDir, null);
            return(res.ExitCode == 0);
        }
예제 #3
0
        public bool Init(BuildMachineSettings settings)
        {
            _Result.Clean();
            _Settings = settings;

            try
            {
                // Make sure the given parameter is valid.
                if (!System.IO.Path.IsPathRooted(_Settings.AbsCMakeWorkspace))
                {
                    Console.WriteLine("CMake Init failed: The path '{0}' is not absolute!", _Settings.AbsCMakeWorkspace);
                    return(false);
                }

                if (!System.IO.Directory.Exists(_Settings.AbsCMakeWorkspace))
                {
                    Console.WriteLine("CMake Init failed: The path '{0}' does not exist!", _Settings.AbsCMakeWorkspace);
                    return(false);
                }

                Console.WriteLine("CMake Init: Workspace: '{0}'.", _Settings.AbsCMakeWorkspace);

                // Run process to get configuration and code dir.
                ezProcessHelper.ProcessResult res = ezProcessHelper.RunExternalExe("cmake", ".", _Settings.AbsCMakeWorkspace, _Result);

                // Determine the configuration this server is taking care of if non is set.
                if (String.IsNullOrEmpty(_Settings.Configuration) && !DetermineConfiguration())
                {
                    return(false);
                }

                Console.WriteLine("CMake Init: Configuration: '{0}'.", _Settings.Configuration);

                // Determine the code directory this CMake workspace belongs to.
                if (!DetermineCodeDirectory())
                {
                    return(false);
                }

                // Determine the bin directory where executables are build to.
                if (!DetermineBinDirectory())
                {
                    return(false);
                }

                Console.WriteLine("CMake Init: Code Path: '{0}'.", _Settings.AbsCodePath);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return(false);
            }

            return(true);
        }
예제 #4
0
        bool CheckForNewRevision()
        {
            _iLastSVNCheckTimestamp = LinuxDateTime.Now();

            // Call 'svn info' on the server and extract the HEAD revision from the stdout stream.
            const string sRevisionToken = "Revision: ";
            string       sArguments     = string.Format("info -r HEAD {0} --username {1} --password {2} --non-interactive --trust-server-cert",
                                                        _Settings.SVNServer, _Settings.SVNUsername, _Settings.SVNPassword);

            ezProcessHelper.ProcessResult ProcessRes = ezProcessHelper.RunExternalExe("svn", sArguments, _Settings.AbsOutputFolder, null, 20 * 1000);
            if (ProcessRes.ExitCode != 0)
            {
                return(false);
            }

            string[] lines = ProcessRes.StdOut.Split('\n');
            foreach (string line in lines)
            {
                if (line.StartsWith(sRevisionToken))
                {
                    string sValue = line.Substring(sRevisionToken.Length);
                    try
                    {
                        int iRev = Convert.ToInt32(sValue);
                        if (iRev != _HeadRevision)
                        {
                            lock (_Lock)
                            {
                                _HeadRevision = iRev;
                                Console.WriteLine("HEAD revision: {0}", _HeadRevision);
                            }
                        }
                    }
                    catch (FormatException)
                    {
                        Console.WriteLine("'CheckForNewRevision' failed to extract revision number from line: '{0}", line);
                        return(false);
                    }
                    return(true);
                }
            }

            lock (_Lock)
            {
                Console.WriteLine("'CheckForNewRevision' failed to find the revision line in the svn: '{0}{1}", ProcessRes.StdOut, ProcessRes.ErrorOut);
                _HeadRevision = -1;
            }
            return(false);
        }
예제 #5
0
 public bool CleanSolution(string sAbsWorkingDir)
 {
     ezProcessHelper.ProcessResult res = ezProcessHelper.RunExternalExe("xcodebuild", "-alltargets clean", sAbsWorkingDir, null);
     return(res.ExitCode == 0);
 }
예제 #6
0
 public bool CleanSolution(string sAbsWorkingDir)
 {
     ezProcessHelper.ProcessResult res = ezProcessHelper.RunExternalExe("make", "clean", sAbsWorkingDir, null);
     return(res.ExitCode == 0);
 }
예제 #7
0
파일: SVN.cs 프로젝트: eltld/ezEngine
 public override void Clean()
 {
     base.Clean();
     ProcessRes = null;
 }