private void PrepareAllCurrentProjectAddiotionalPaths(string currentUserName, string currentTfsUserName, ProjectViewModel cProject, AgentMachineViewModel currentSelectedMachine, string msTestProjPath, string tfsProj)
        {
            foreach (var cAdditionalPath in cProject.ObservableAdditionalPaths)
            {
                string localPath     = ATACore.Project.ProjectInfoCollector.MapWorkingDirTfsPath(currentSelectedMachine.WorkingDirPath, cProject.TfsPath);
                string workspaceName = ATACore.RegistryManager.GetWorkspaceName(currentUserName, localPath);
                string tfsUrl        = cAdditionalPath.TfsUrl;
                string tfsPath       = cAdditionalPath.TfsPath;

                GenerateProjectWorkspaceDeletionMessages(currentTfsUserName, tfsProj, tfsUrl, cAdditionalPath.WorkspacesForDelete);
                GenerateProjectWorkspaceCreationMessages(tfsProj, tfsUrl, tfsPath, localPath, workspaceName);
                CommandsToBeExecuted.Add(ATACore.CommandExecutor.GenerateTfsGetLatestMessage(tfsProj, localPath, currentTfsUserName, CurrentAgentMachineMsBuildLogIpSettings));
            }
        }
        private void PrepareAllCurrentProjectAddiotionalPaths(string currentUserName, string currentTfsUserName, ProjectViewModel cProject, AgentMachineViewModel currentSelectedMachine, string msTestProjPath, string tfsProj)
        {
            foreach (var cAdditionalPath in cProject.ObservableAdditionalPaths)
            {
                string localPath = ATACore.Project.ProjectInfoCollector.MapWorkingDirTfsPath(currentSelectedMachine.WorkingDirPath, cProject.TfsPath);
                string workspaceName = ATACore.RegistryManager.GetWorkspaceName(currentUserName, localPath);
                string tfsUrl = cAdditionalPath.TfsUrl;
                string tfsPath = cAdditionalPath.TfsPath;

                GenerateProjectWorkspaceDeletionMessages(currentTfsUserName, tfsProj, tfsUrl, cAdditionalPath.WorkspacesForDelete);
                GenerateProjectWorkspaceCreationMessages(tfsProj, tfsUrl, tfsPath, localPath, workspaceName);
                CommandsToBeExecuted.Add(ATACore.CommandExecutor.GenerateTfsGetLatestMessage(tfsProj, localPath, currentTfsUserName, CurrentAgentMachineMsBuildLogIpSettings));
            }
        }
        private void PrepareAllCurrentProjectAddiotionalPaths(List<Task> taskToBeExecuted, string tfsProjectPath, string currentUserName, string currentTfsUserName, ProjectViewModel cProject, IpAddressSettings msBuildLoggerIpSettings)
        {
            foreach (var cAdditionalPath in cProject.ObservableAdditionalPaths)
            {
                string localPath = GetProjectLocalPath(currentUserName, cAdditionalPath.TfsPath);
                string workspaceName = ATACore.RegistryManager.GetWorkspaceName(currentUserName, localPath);
                string tfsUrl = cAdditionalPath.TfsUrl;
                string tfsPath = cAdditionalPath.TfsPath;

                Task t1 = taskToBeExecuted[taskToBeExecuted.Count - 1].ContinueWith((antecedent) =>
                {
                    if (!String.IsNullOrEmpty(workspaceName))
                    {
                        DeleteWorkSpaceIfExists(tfsProjectPath, currentTfsUserName, tfsUrl, msBuildLoggerIpSettings, workspaceName);
                        cAdditionalPath.WorkspacesForDelete.Add(workspaceName);
                    }
                });

                taskToBeExecuted.Add(t1);
         
                if (!AlreadyCreatedWorkspaces.Contains(tfsPath))
                {
                    ATACore.Utilities.FilesDeleter.DeleteAllFilesAndFolders(localPath);
                    string newWorkspaceName = Guid.NewGuid().ToString();
                    Task t2 = taskToBeExecuted[taskToBeExecuted.Count - 1].ContinueWith((antecedent) => CreateNewWorkspace(tfsProjectPath, currentUserName, tfsUrl, tfsPath, localPath, msBuildLoggerIpSettings, newWorkspaceName));
                    taskToBeExecuted.Add(t2);
                    AlreadyCreatedWorkspaces.Add(tfsPath);
                }
                Task t3 = taskToBeExecuted[taskToBeExecuted.Count - 1].ContinueWith((antecedent) => GetLatest(tfsProjectPath, currentTfsUserName, localPath, msBuildLoggerIpSettings));
                taskToBeExecuted.Add(t3);
            }
        }
예제 #4
0
 public ProjectTestsExecutionViewModel(ProjectViewModel project) :
     this(project.ProjectId, project.Name, project.TfsPath, project.TfsUrl, project.IsSelected, project.LocalPath, project.WorkspacesForDelete)
 {
 }
 public ProjectTestsExecutionViewModel(ProjectViewModel project) : 
     this(project.ProjectId, project.Name, project.TfsPath, project.TfsUrl, project.IsSelected, project.LocalPath, project.WorkspacesForDelete)
 {
 }
예제 #6
0
        private void PrepareAllCurrentProjectAddiotionalPaths(List <Task> taskToBeExecuted, string tfsProjectPath, string currentUserName, string currentTfsUserName, ProjectViewModel cProject, IpAddressSettings msBuildLoggerIpSettings)
        {
            foreach (var cAdditionalPath in cProject.ObservableAdditionalPaths)
            {
                string localPath     = GetProjectLocalPath(currentUserName, cAdditionalPath.TfsPath);
                string workspaceName = ATACore.RegistryManager.GetWorkspaceName(currentUserName, localPath);
                string tfsUrl        = cAdditionalPath.TfsUrl;
                string tfsPath       = cAdditionalPath.TfsPath;

                Task t1 = taskToBeExecuted[taskToBeExecuted.Count - 1].ContinueWith((antecedent) =>
                {
                    if (!String.IsNullOrEmpty(workspaceName))
                    {
                        DeleteWorkSpaceIfExists(tfsProjectPath, currentTfsUserName, tfsUrl, msBuildLoggerIpSettings, workspaceName);
                        cAdditionalPath.WorkspacesForDelete.Add(workspaceName);
                    }
                });

                taskToBeExecuted.Add(t1);

                if (!AlreadyCreatedWorkspaces.Contains(tfsPath))
                {
                    ATACore.Utilities.FilesDeleter.DeleteAllFilesAndFolders(localPath);
                    string newWorkspaceName = Guid.NewGuid().ToString();
                    Task   t2 = taskToBeExecuted[taskToBeExecuted.Count - 1].ContinueWith((antecedent) => CreateNewWorkspace(tfsProjectPath, currentUserName, tfsUrl, tfsPath, localPath, msBuildLoggerIpSettings, newWorkspaceName));
                    taskToBeExecuted.Add(t2);
                    AlreadyCreatedWorkspaces.Add(tfsPath);
                }
                Task t3 = taskToBeExecuted[taskToBeExecuted.Count - 1].ContinueWith((antecedent) => GetLatest(tfsProjectPath, currentTfsUserName, localPath, msBuildLoggerIpSettings));
                taskToBeExecuted.Add(t3);
            }
        }