Exemple #1
0
        public IEnumerable <DevOpsTask> LoadTasks(TaskModel model)
        {
            var definitionPath = Path.Combine(model.Path, string.Format("{0}.tasks", model.Project));

            var tasks = XmlSerialisationManager <DevOpsTask> .DeserializeObjects(definitionPath);

            if (tasks != null)
            {
                return(tasks);
            }

            return(null);
        }
        public static IEnumerable <DevOpsTask> LoadTasks(TaskModel model)
        {
            var definitionPath = Path.Combine(model.Path, "tasks", string.Format("{0}.local.tasks", model.Task));

            if (!File.Exists(definitionPath))
            {
                throw new DevOpsTaskException(string.Format("Cannot find local task definition {0}", definitionPath));
            }

            var tasks = XmlSerialisationManager <DevOpsTask> .DeserializeObjects(definitionPath);

            if (tasks != null)
            {
                return(tasks);
            }

            return(null);
        }
Exemple #3
0
        private ICollection <DevOpsTask> GetTasksFromFile(string filePath)
        {
            try
            {
                var tasks = XmlSerialisationManager <DevOpsTask> .DeserializeObjects(filePath);

                if (tasks != null)
                {
                    return(tasks);
                }
            }
            catch (Exception e)
            {
                RaiseException(e);
            }

            return(null);
        }