Run() public method

Executes the default target and wraps in error handling and time stamping.
public Run ( ) : bool
return bool
Example #1
0
 public void Execute_tests_in_test_build_script()
 {
     var project = new Project("NBehaveTestScript.build", Level.Info, 1);
     Assert.IsTrue(project.Run(), "Something went wrong executing the test script.  Check log.");
 }
        protected override void DoRun()
        {
            try
            {
                Environment.CurrentDirectory = _fileInfo.DirectoryName;

                _project = new Project(_fileInfo.FullName, GetThreshold(), 0);
                _project.BuildFinished += Build_Finished;

                SetTargetFramework();
                AddBuildListeners();
                AddProperties();
                AddTargets();

                _project.Run();
            }
            catch (ArgumentException error)
            {
                _logger.LogMessage(error.Message);
                FinishBuild();
            }
            catch (BuildException error)
            {
                _logger.LogMessage(error.Message);
                FinishBuild();
            }
        }