예제 #1
0
        public void StartWrapperProcess()
        {
            string wrapperName = _wrapperExecutableNameProvider.GetWrapperExecutableName();

            _wrapperProcess = _processFactory.GetProcess(wrapperName, _pipeToken.Token);
            _wrapperProcess.Start();
        }
예제 #2
0
        protected virtual void ProcessBuild(IPackageTree packageTree, IProcessFactory processFactory, string pathToBuildTool, string cmdLineArguments)
        {
            IProcess process = processFactory.GetProcess(pathToBuildTool, cmdLineArguments, packageTree.WorkingDirectory.FullName);

            while (true)
            {
                string line = process.GetLineOrOutput();

                if (line == null)
                {
                    break;
                }

                log.Info(line);
            }

            try
            {
                process.WaitForExit();
            }
            catch (ProcessFailedException)
            {
                throw new BuildFailedException(string.Format("The build tool {0} failed building the {1} package", packageTree.BuildMetaData.BuildEngine.BuildTool, packageTree.Name));
            }
        }
예제 #3
0
        public virtual void GenerateKeyFile(IProcessFactory processFactory, IPackageTree packageTree)
        {
            string strongKey = Path.Combine(packageTree.WorkingDirectory.FullName,
                                            string.Format("{0}.snk", packageTree.Name));

            string cmdLineArguments = string.Format("-k {0}", strongKey.QuotePath());

            var PSI = new ProcessStartInfo("cmd.exe")
            {
                RedirectStandardInput  = true,
                RedirectStandardOutput = true,
                RedirectStandardError  = true,
                UseShellExecute        = false
            };

            var sn = GetSnExe(packageTree);

            IProcess process = processFactory.GetProcess(sn.ToString().QuotePath(), cmdLineArguments, packageTree.WorkingDirectory.FullName);

            while (true)
            {
                string line = process.GetLineOrOutput();

                if (line == null)
                {
                    break;
                }

                log.Info(line);
            }

            process.WaitForExit();
        }
        public void StartWrapperProcess()
        {
            string wrapperName = _wrapperExecutableNameProvider.GetWrapperExecutableName();

            _wrapperProcess = _processFactory.GetProcess(wrapperName, _pipeToken.Token, _wrapperConfiguration.WorkingDirectory);

            _wrapperProcess.Start();
        }
예제 #5
0
        public IResponseMessage RunCommand <T>(IRequest request)
        {
            IProcess process = processFactory.GetProcess(request);

            IResponseMessage validationResponseMessage = process.Validate(request);

            if (validationResponseMessage.StatusCode != Status.FAILURE)
            {
                return(process.Process(request));
            }
            return(validationResponseMessage);
        }
예제 #6
0
        private ProcessWrapper StartProcess(string command, string workingDirectory)
        {
            var process = _process.GetProcess();

            process.StartInfo.FileName  = "/bin/bash";
            process.StartInfo.Arguments = $"-c \"{command}\"";
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.CreateNoWindow         = true;
            process.StartInfo.RedirectStandardError  = true;
            process.StartInfo.WorkingDirectory       = workingDirectory;

            process.Start();
            return(process);
        }
예제 #7
0
        protected virtual void ProcessBuild(IPackageTree packageTree, IProcessFactory processFactory, string pathToBuildTool, string cmdLineArguments)
        {
            IProcess process = processFactory.GetProcess(pathToBuildTool, cmdLineArguments, packageTree.WorkingDirectory.FullName);

            while (true)
            {
                string line = process.GetLineOrOutput();

                if (line == null)
                    break;

                log.Info(line);
            }

            try
            {
                process.WaitForExit();
            }
            catch (ProcessFailedException)
            {
                throw new BuildFailedException(string.Format("The build tool {0} failed building the {1} package", packageTree.BuildMetaData.BuildEngine.BuildTool, packageTree.Name));
            }
        }
예제 #8
0
        public virtual void GenerateKeyFile(IProcessFactory processFactory, IPackageTree packageTree)
        {
            string strongKey = Path.Combine(packageTree.WorkingDirectory.FullName,
                                            string.Format("{0}.snk", packageTree.Name));

            string cmdLineArguments = string.Format("-k {0}", strongKey.QuotePath());

            var PSI = new ProcessStartInfo("cmd.exe")
                                       {
                                           RedirectStandardInput = true,
                                           RedirectStandardOutput = true,
                                           RedirectStandardError = true,
                                           UseShellExecute = false
                                       };

            var sn = GetSnExe(packageTree);

            IProcess process = processFactory.GetProcess(sn.ToString().QuotePath(), cmdLineArguments, packageTree.WorkingDirectory.FullName);

            while (true)
            {
                string line = process.GetLineOrOutput();

                if (line == null)
                    break;

                log.Info(line);
            }

            process.WaitForExit();
        }
예제 #9
0
        public string RunCommand(string command, string args, string workingDirectory)
        {
            IProcess process = processFactory.GetProcess(command, args, workingDirectory);

            return(process.GetLineOrOutput());
        }