当前位置: 首页>>代码示例>>C#>>正文


C# IIntegrationResult.BaseFromWorkingDirectory方法代码示例

本文整理汇总了C#中IIntegrationResult.BaseFromWorkingDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# IIntegrationResult.BaseFromWorkingDirectory方法的具体用法?C# IIntegrationResult.BaseFromWorkingDirectory怎么用?C# IIntegrationResult.BaseFromWorkingDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IIntegrationResult的用法示例。


在下文中一共展示了IIntegrationResult.BaseFromWorkingDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSource

        public override void GetSource(IIntegrationResult result)
        {
            result.BuildProgressInformation.SignalStartRunTask("Getting source from Vault");

            if (!_shim.AutoGetSource) return;
            if (_folderVersion <= 0)
            {
                throw new CruiseControlException("_folderVersion <= 0 when attempting to get source.  This shouldn't happen.");
            }

            if (_shim.CleanCopy)
            {
                string cleanCopyWorkingFolder = null;
                if (string.IsNullOrEmpty(_shim.WorkingDirectory))
                {
                    cleanCopyWorkingFolder = GetVaultWorkingFolder(result);
                    if (string.IsNullOrEmpty(cleanCopyWorkingFolder))
                        throw new VaultException(
                            string.Format("Vault user {0} has no working folder set for {1} in repository {2} and no working directory has been specified.",
                                          _shim.Username, _shim.Folder, _shim.Repository));
                }
                else
                    cleanCopyWorkingFolder = result.BaseFromWorkingDirectory(_shim.WorkingDirectory);

                Log.Debug("Cleaning out source folder: " + cleanCopyWorkingFolder);
                fileDirectoryDeleter.DeleteIncludingReadOnlyObjects(cleanCopyWorkingFolder);
            }

            Log.Info("Getting source from Vault");
            Execute(GetSourceProcessInfo(result));
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:31,代码来源:Vault317.cs

示例2: GetSource

        public override void GetSource(IIntegrationResult result)
        {
            if (!_shim.AutoGetSource) return;
            Debug.Assert(_folderVersion > 0, "_folderVersion <= 0 when attempting to get source.  This shouldn't happen.");

            if (_shim.CleanCopy)
            {
                string cleanCopyWorkingFolder = null;
                if (StringUtil.IsBlank(_shim.WorkingDirectory))
                {
                    cleanCopyWorkingFolder = GetVaultWorkingFolder(result);
                    if (StringUtil.IsBlank(cleanCopyWorkingFolder))
                        throw new VaultException(
                            string.Format("Vault user {0} has no working folder set for {1} in repository {2} and no working directory has been specified.",
                                          _shim.Username, _shim.Folder, _shim.Repository));
                }
                else
                    cleanCopyWorkingFolder = result.BaseFromWorkingDirectory(_shim.WorkingDirectory);

                Log.Debug("Cleaning out source folder: " + cleanCopyWorkingFolder);
                new IoService().EmptyDirectoryIncludingReadOnlyObjects(cleanCopyWorkingFolder);
            }

            Log.Info("Getting source from Vault");
            Execute(GetSourceProcessInfo(result));
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:26,代码来源:Vault317.cs

示例3: Evaluate

 /// <summary>
 /// Performs the actual evaluation.
 /// </summary>
 /// <param name="result">The result.</param>
 /// <returns>
 /// <c>true</c> if the condition is true; <c>false</c> otherwise.
 /// </returns>
 protected override bool Evaluate(IIntegrationResult result)
 {
     var folderName = result.BaseFromWorkingDirectory(this.FolderName);
     this.LogDescriptionOrMessage("Checking for folder '" + folderName + "'");
     var fileSystem = this.FileSystem ?? new SystemIoFileSystem();
     var exists = fileSystem.DirectoryExists(folderName);
     return exists;
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:15,代码来源:FolderExistsTaskCondition.cs

示例4: GetModifications

 public Modification[] GetModifications(IIntegrationResult from, IIntegrationResult to)
 {
     var path = to.BaseFromWorkingDirectory(this.FileName);
     using (var reader = new StreamReader(path))
     {
         var parser = new IndexFileHistoryParser();
         return parser.Parse(reader, from.StartTime, to.StartTime);
     }
 }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:9,代码来源:IndexFileSourceControl.cs

示例5: Generate

        /// <summary>
        /// Generate a manifest for a package.
        /// </summary>
        /// <param name="result">The result of the build.</param>
        /// <param name="packagedFiles">The files that were packaged.</param>
        /// <returns>An <see cref="XmlDocument"/> containing the manifest.</returns>
        public XmlDocument Generate(IIntegrationResult result, string[] packagedFiles)
        {
            if (string.IsNullOrEmpty(fileName)) throw new ArgumentOutOfRangeException("FileName");

            XmlDocument manifest = new XmlDocument();
            string actualFile = fileName;
            if (!Path.IsPathRooted(actualFile)) actualFile = result.BaseFromWorkingDirectory(actualFile);
            manifest.Load(actualFile);
            return manifest;
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:16,代码来源:ManifestImporter.cs

示例6: GetSource

 public void GetSource(IIntegrationResult result)
 {
     foreach (var modification in result.Modifications)
     {
         var source = Path.Combine(
             modification.FolderName,
             modification.FileName);
         var destination = result.BaseFromWorkingDirectory(
             modification.FileName);
         if (File.Exists(source))
         {
             File.Copy(source, destination, true);
         }
         else
         {
             File.Delete(destination);
         }
     }
 }
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:19,代码来源:NewFileSystemSourceControl.cs

示例7: ExecuteCommand

        private ProcessResult ExecuteCommand(IIntegrationResult result, 
            string command, params string[] args)
        {
            var buffer = new PrivateArguments(command);
            buffer.Add(this.Source);
            foreach (var arg in args)
            {
                buffer.Add(string.Empty,
                    arg,
                    true);
            }

            var executable = string.IsNullOrEmpty(this.Executable) ?
                "GetMyCode" : this.Executable;
            var processInfo = new ProcessInfo(
                result.BaseFromWorkingDirectory(executable),
                buffer,
                result.WorkingDirectory);
            var processResult = this.Execute(processInfo);
            return processResult;
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:21,代码来源:GetMyCodeSourceControl.cs

示例8: NewProcessInfo

 private ProcessInfo NewProcessInfo(string args, IIntegrationResult result)
 {
     ProcessInfo pi = new ProcessInfo(Executable, args, result.BaseFromWorkingDirectory(WorkingDirectory));
     // Needed to disable the pager for bk commands, which causes infinite hangs
     pi.EnvironmentVariables.Add("PAGER", "cat");
     return pi;
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:7,代码来源:BitKeeper.cs

示例9: Execute

        /// <summary>
        /// Execute the actual task functionality.
        /// </summary>
        /// <param name="result"></param>
        /// <returns>
        /// True if the task was successful, false otherwise.
        /// </returns>
        protected override bool Execute(IIntegrationResult result)
        {
            result.BuildProgressInformation.SignalStartRunTask(!string.IsNullOrEmpty(Description) ? Description : "Publishing build results");

            if (result.Succeeded || AlwaysPublish)
            {
                var srcDir = new DirectoryInfo(result.BaseFromWorkingDirectory(SourceDir));
                var pubDir = new DirectoryInfo(result.BaseFromArtifactsDirectory(PublishDir));
                Log.Debug("Publish directory is '{0}'", pubDir.FullName);
                Log.Debug("Source directory is '{0}'", srcDir.FullName);
                if (!srcDir.Exists)
                {
                    Log.Warning("Source directory '{0}' does not exist - cancelling task", srcDir.FullName);
                    var errorResult = new GeneralTaskResult(
                        false,
                        "Unable to find source directory '" + srcDir.FullName + "'");
                    result.AddTaskResult(errorResult);
                    return false;
                }

                if (!pubDir.Exists)
                {
                    Log.Info("Publish directory '{0}' does not exist - creating", pubDir.FullName);
                    pubDir.Create();
                }
                else
                {
                    if (CleanPublishDirPriorToCopy)
                    {
                        DeleteFolder(pubDir.FullName);
                        pubDir.Create();
                    }
                }

                if (UseLabelSubDirectory)
                    pubDir = pubDir.CreateSubdirectory(result.Label);

                RecurseSubDirectories(srcDir, pubDir, this.Recurse);

                switch (CleanUpMethod)
                {
                    case CleanupPolicy.NoCleaning:
                        break;

                    case CleanupPolicy.DeleteBuildsOlderThanXDays:
                        DeleteSubDirsOlderThanXDays(new DirectoryInfo(result.BaseFromArtifactsDirectory(PublishDir)).FullName,
                                                    CleanUpValue, result.BuildLogDirectory);
                        break;

                    case CleanupPolicy.KeepLastXBuilds:
                        KeepLastXSubDirs(new DirectoryInfo(result.BaseFromArtifactsDirectory(PublishDir)).FullName,
                                                    CleanUpValue, result.BuildLogDirectory);
                        break;

                    default:
                        throw new System.Exception(string.Format(System.Globalization.CultureInfo.CurrentCulture, "unmapped cleaning method choosen {0}", CleanUpMethod));
                }
            }

            return true;
        }
开发者ID:KevinFernandes,项目名称:CCNetEnhancedBuildPublisher,代码行数:68,代码来源:EnhancedBuildPublisher.cs

示例10: GetProcessBaseDirectory

 protected override string GetProcessBaseDirectory(IIntegrationResult result)
 {
     return result.BaseFromWorkingDirectory(BaseDirectory);
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:4,代码来源:RakeTask.cs

示例11: BaseDirectory

 private string BaseDirectory(IIntegrationResult result)
 {
     return result.BaseFromWorkingDirectory(ConfiguredScriptsDirectory);
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:4,代码来源:PowerShellTask.cs

示例12: GetProcessArguments

        /// <summary>
        /// Retrieve the arguments
        /// </summary>
        /// <param name="result">The result.</param>
        /// <returns>A <c>string</c> containing the arguments.</returns>
        protected override string GetProcessArguments(IIntegrationResult result)
        {
            ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
            buffer.AddArgument("/quiet");
            buffer.AddArgument("/severityThreshold:\"" + this.ReportingThreshold.ToString() + "\"");
            buffer.AddArgument("/out:\"" + result.BaseFromWorkingDirectory("codeitright.xml") + "\"");
            if (!string.IsNullOrEmpty(this.Solution))
            {
                buffer.AddArgument("/Solution:\"" + this.EnsurePathIsRooted(result, this.Solution) + "\"");
            }
            else if (!string.IsNullOrEmpty(this.Project))
            {
                buffer.AddArgument("/Project:\"" + this.EnsurePathIsRooted(result, this.Project) + "\"");
            }
            else
            {
                throw new CruiseControlException("Either a solution or a project must be specified for analysis.");
            }

            if (!string.IsNullOrEmpty(this.Xsl))
            {
                buffer.AddArgument("/outxsl:\"" + this.EnsurePathIsRooted(result, this.Xsl) + "\"");
            }

            if (!string.IsNullOrEmpty(this.CRData))
            {
                buffer.AddArgument("/crdata:\"" + this.EnsurePathIsRooted(result, this.CRData) + "\"");
            }

            if (!string.IsNullOrEmpty(this.Profile))
            {
                buffer.AddArgument("/profile:\"" + this.Profile + "\"");
            }

            return buffer.ToString();
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:41,代码来源:CodeItRightTask.cs

示例13: NewProcessInfoWithArgs

        private ProcessInfo NewProcessInfoWithArgs(IIntegrationResult result, string args)
        {
            var wd = result.BaseFromWorkingDirectory(WorkingDirectory);
            // ensure working directory exists
            fileSystem.EnsureFolderExists(wd);

            var pi = new ProcessInfo(Executable, args, wd);
            SetEnvironmentVariables(pi, result);
            return pi;
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:10,代码来源:Cvs.cs

示例14: NewCheckoutProcessInfo

 private ProcessInfo NewCheckoutProcessInfo(IIntegrationResult result)
 {
     var buffer = new PrivateArguments("checkout");
     buffer.Add(string.Empty, TrunkUrl, true);
     buffer.Add(null, Path.GetFullPath(result.BaseFromWorkingDirectory(WorkingDirectory)), true);
     AppendCommonSwitches(buffer);
     return NewProcessInfo(buffer, result);
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:8,代码来源:Svn.cs

示例15: DoesSvnDirectoryExist

 private bool DoesSvnDirectoryExist(IIntegrationResult result)
 {
     string svnDirectory = Path.Combine(result.BaseFromWorkingDirectory(WorkingDirectory), ".svn");
     string underscoreSvnDirectory = Path.Combine(result.BaseFromWorkingDirectory(WorkingDirectory), "_svn");
     return fileSystem.DirectoryExists(svnDirectory) || fileSystem.DirectoryExists(underscoreSvnDirectory);
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:6,代码来源:Svn.cs


注:本文中的IIntegrationResult.BaseFromWorkingDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。