/// <summary> /// Start the deployment /// </summary> public bool Start() { StartingTime = DateTime.Now; _maxStep = _proEnv.Deployer.DeployTransferRules.Count > 0 ? _proEnv.Deployer.DeployTransferRules.Max(rule => rule.Step) : 0; _filesToDeployPerStep.Clear(); // new mass compilation _proCompilation = new MultiCompilation(_proEnv) { // check if we need to force the compiler to only use 1 process // (either because the user want to, or because we have a single user mode database) MonoProcess = _currentProfile.ForceSingleProcess || _proEnv.IsDatabaseSingleUser, NumberOfProcessesPerCore = _currentProfile.NumberProcessPerCore, RFilesOnly = _currentProfile.OnlyGenerateRcode, IsTestMode = IsTestMode, IsAnalysisMode = IsAnalysisMode }; _proCompilation.OnCompilationOk += OnCompilationOk; _proCompilation.OnCompilationFailed += OnCompilationFailed; // compile files that have a transfer planned return(BeforeStarting() && _proCompilation.CompileFiles( GetFilesToCompileInStepZero() .Where(toCompile => _proEnv.Deployer.GetTransfersNeededForFile(toCompile.SourcePath, 0).Count > 0) .ToNonNullList() )); }
/// <summary> /// Called when the compilation step 0 failed /// </summary> protected void OnCompilationFailed(MultiCompilation proCompilation) { if (HasBeenCancelled) { return; } CompilationHasFailed = true; EndOfDeployment(); }
/// <summary> /// Called when the compilation step 0 ended correctly /// </summary> protected void OnCompilationOk(MultiCompilation comp, List <FileToCompile> fileToCompiles, List <FileToDeploy> filesToDeploy) { if (HasBeenCancelled) { return; } // Make the deployment for the compilation step (0) _filesToDeployPerStep.Add(0, Deployfiles(filesToDeploy)); comp.Clean(); // Make the deployment for the step 1 and >= ExecuteDeploymentHook(0); }
/// <summary> /// Called when the compilation step 0 ended correctly /// </summary> protected void OnCompilationOk(MultiCompilation comp, List <FileToCompile> fileToCompiles, List <FileToDeploy> filesToDeploy) { if (HasBeenCancelled) { return; } // Make the deployment for the compilation step (0) try { _filesToDeployPerStep.Add(0, Deployfiles(filesToDeploy)); } catch (Exception e) { ErrorHandler.ShowErrors(e); } comp.Clean(); // Make the deployment for the step 1 and >= ExecuteDeploymentHook(0); }