Esempio n. 1
0
 async Task CheckTaskRunnerAvailableForFile(ProjectFileEventArgs eventArgs)
 {
     foreach (ProjectFileEventInfo fileEventInfo in eventArgs)
     {
         FilePath    configFile = fileEventInfo.ProjectFile.FilePath;
         ITaskRunner runner     = taskRunnerProvider.GetTaskRunner(configFile);
         if (runner != null)
         {
             if (!TaskAlreadyAdded(fileEventInfo.Project, configFile))
             {
                 await AddTaskRunner(runner, configFile, fileEventInfo.Project);
             }
         }
     }
 }
Esempio n. 2
0
        public async Task <List <TaskRunnerInformation> > FindTasks(
            IWorkspaceFileObject workspaceFileObject,
            HashSet <FilePath> filesAdded)
        {
            List <TaskRunnerInformation> foundTasks = null;

            foreach (FilePath configFile in GetFiles(workspaceFileObject))
            {
                if (!filesAdded.Contains(configFile))
                {
                    ITaskRunner runner = taskRunnerProvider.GetTaskRunner(configFile);
                    if (runner != null)
                    {
                        ITaskRunnerConfig config = await runner.ParseConfig(null, configFile);

                        var info = new TaskRunnerInformation(workspaceFileObject, config, runner.Options, configFile);
                        if (foundTasks == null)
                        {
                            foundTasks = new List <TaskRunnerInformation> ();
                        }
                        foundTasks.Add(info);
                        filesAdded.Add(configFile);
                    }
                }
            }

            return(foundTasks);
        }