Exemple #1
0
        public void AddProcess(string name, IProcessTemplate template)
        {
            IProcessBuilder builder = ProcessBuilder.GetProcessBuilder();
            IProcess        process = builder.Build(this, template);

            this.processes.Add(name, process);
        }
        private void ProcessTemplateEditorEditValueChanged(object sender, EventArgs e)
        {
            if (ProcessTemplateEditor.EditValue != null)
            {
                var control = new ProcessTemplateSelector().GetTemplate(ProcessTemplateEditor.EditValue.ToString());

                PanelBusinessProcessTemplate.Controls.Clear();

                if (control != null)
                {
                    PanelBusinessProcessTemplate.Controls.Add(control);
                    control.Dock = DockStyle.Fill;
                    //var initialized = (IInitialized) control;
                    //initialized.Init();

                    _selectedTemplate = control as IProcessTemplate;
                    if (_selectedTemplate != null)
                    {
                        _selectedTemplate.EditMode       = EditMode;
                        _selectedTemplate.ConfigId       = ConfigId();
                        _selectedTemplate.DocumentId     = DocumentId();
                        _selectedTemplate.Version        = Version();
                        _selectedTemplate.ProcessBuilder = this;
                        ReloadExistingHandlers();
                        _selectedTemplate.OnInitTemplate();
                        _selectedTemplate.Process = _process;
                    }
                }
            }
        }
 public ProcessRules(IFileAccess <List <Rule> > fileAccess, IOptions <AppConfig> settings, IScriptCheck scriptCheck, IProcessTemplate processTemplate, IReplaceLogic replaceLogic)
 {
     _fileAccess      = fileAccess;
     _settings        = settings.Value;
     _scriptCheck     = scriptCheck;
     _processTemplate = processTemplate;
     _replaceLogic    = replaceLogic;
 }
        private IProcessTemplate EnsureProjectHasBuildProcessTemplate(string teamProject, string templateServerPath)
        {
            IProcessTemplate template = this.buildServer.QueryProcessTemplates(teamProject).FirstOrDefault(pt => pt.ServerPath == templateServerPath);

            if (template == null)
            {
                template = this.buildServer.CreateProcessTemplate(teamProject, templateServerPath);
                template.Save();
            }

            return(template);
        }
Exemple #5
0
        public BuildProcessTemplateInfo(IProcessTemplate processTemplate, IList <IBuildDefinition> buildDefinitions)
        {
            this.ProcessTemplate  = processTemplate;
            this.BuildDefinitions = buildDefinitions ?? new IBuildDefinition[0];
            var buildDefinitionsDescription = new StringBuilder();

            foreach (var buildDefinition in this.BuildDefinitions.OrderBy(b => b.Name))
            {
                if (buildDefinitionsDescription.Length > 0)
                {
                    buildDefinitionsDescription.Append(", ");
                }
                buildDefinitionsDescription.Append(buildDefinition.Name);
            }
            this.BuildDefinitionsDescription = buildDefinitionsDescription.ToString();
        }
        public IProcess Build(LivingSystem system, IProcessTemplate template)
        {
            IProcess mainProcess = new Process(system);

            mainProcess.ProcessTemplate = template;
            dynamic basicTemplate = template as BasicProcessTemplate;

            if (basicTemplate == null)
            {
                return(null);
            }
            if (basicTemplate.ComponentTypes.Contains(ComponentType.REPRODUCER))
            {
                mainProcess = new ProcessReproducerDecorator(mainProcess);
            }
            return(mainProcess);
        }
        public CommonStructure(BaseUpdateOptions options)
        {
            // Read config options
            Collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(options.TeamCollection));
            BuildServer = Collection.GetService<IBuildServer>();
            CommonStructureService = Collection.GetService<ICommonStructureService>();

            string standardTemplateName = GetConfigValueAsString(SettingsKeys.StandardTemplateName,
                Constants.DefaultStandardTemplateName);
            string servicesTemplateName = GetConfigValueAsString(SettingsKeys.ServicesTemplate,
                Constants.DefaultServicesTemplateName);
            string noCompileFullTemplateName = GetConfigValueAsString(SettingsKeys.NoCompileFullTemplate,
                Constants.DefaultNoCompileFullTemplateName);

            StandardTemplatePath = String.Format("$/{0}/BuildProcessTemplates/{1}", options.TemplatesTeamProject,
                standardTemplateName);
            ServicesTemplatePath = String.Format("$/{0}/BuildProcessTemplates/{1}", options.TemplatesTeamProject,
                servicesTemplateName);
            NoCompileFullTemplatePath = String.Format("$/{0}/BuildProcessTemplates/{1}", options.TemplatesTeamProject,
                noCompileFullTemplateName);

            StandardTemplate = CheckCreate(options.TemplatesTeamProject, StandardTemplatePath);
            if (StandardTemplate == null)
                Console.WriteLine("Standard template not found in '{0}' of '{1}'", StandardTemplatePath,
                    options.TeamCollection);

            ServicesTemplate = CheckCreate(options.TemplatesTeamProject, ServicesTemplatePath);
            if (ServicesTemplate == null)
                Console.WriteLine("Services template not found in '{0}' of '{1}'", ServicesTemplatePath,
                    options.TeamCollection);

            NoCompileFullTemplate = CheckCreate(options.TemplatesTeamProject, NoCompileFullTemplatePath);
            if (NoCompileFullTemplate == null)
                Console.WriteLine("No-compile template not found in '{0}' of '{1}'", NoCompileFullTemplatePath,
                    options.TeamCollection);

            DeploymentPackagesLocation = GetConfigValueAsString(SettingsKeys.PackagesDropLocation,
                Constants.DefaultPackagesDropLocation);
        }
Exemple #8
0
 public static bool AreEquivalent(IProcessTemplate x, IProcessTemplate y)
 {
     if (x == null && y == null)
     {
         return(true);
     }
     if (x == null || y == null)
     {
         return(false);
     }
     if (x.SupportedReasons != y.SupportedReasons)
     {
         return(false);
     }
     if (x.TemplateType != y.TemplateType)
     {
         return(false);
     }
     if (!string.Equals(x.TeamProject, y.TeamProject, StringComparison.OrdinalIgnoreCase))
     {
         return(false);
     }
     if (!string.Equals(x.ServerPath, y.ServerPath, StringComparison.OrdinalIgnoreCase))
     {
         return(false);
     }
     if (!string.Equals(x.Description, y.Description, StringComparison.OrdinalIgnoreCase))
     {
         return(false);
     }
     if (!string.Equals(x.Parameters, y.Parameters, StringComparison.OrdinalIgnoreCase))
     {
         return(false);
     }
     return(true);
 }
 public BuildTemplateViewModel(IProcessTemplate template)
 {
     this.ServerPath = template.ServerPath;
     this.TeamProject = template.TeamProject;
     this.TemplateType = template.TemplateType.ToString();
 }
 public BuildTemplateViewModel(IProcessTemplate template)
 {
     this.ServerPath   = template.ServerPath;
     this.TeamProject  = template.TeamProject;
     this.TemplateType = template.TemplateType.ToString();
 }