public void Consume(ChangedFile file)
 {
     if (!File.Exists(_configuration.WatchToken))
         return;
     if (file.Extension.ToLower().Equals(".sln"))
     {
         try
         {
             tryCrawl(file);
         }
         catch (IOException ex)
         {
             Debug.WriteException(ex);
             Thread.Sleep(200);
             try
             {
                 tryCrawl(file);
             }
             catch
             {
             }
         }
         catch (Exception ex)
         {
             Debug.WriteException(ex);
         }
     }
 }
		private bool handleProject(string extension, ChangedFile file)
		{
            var isWatchingSolution = File.Exists(_configuration.WatchToken);
			if (file.Extension.ToLower().Equals(extension))
			{
				var project = _cache.Get<Project>(file.FullName);
                if (project == null)
                {
                    if (!isWatchingSolution)
                    {
                        Debug.WriteDebug("Adding and marking project for rebuild " + file.FullName);
                        _cache.Add<Project>(file.FullName);
                        project = _cache.Get<Project>(file.FullName);
                    }
                }
                else
                {
                    Debug.WriteDebug("Reloading and marking project for rebuild " + file.FullName);
                    _cache.Reload<Project>(file.FullName);
                    project = _cache.Get<Project>(file.FullName);
                }
				return true;
			}
			return false;
		}
		public void SetDataFrom(BinaryReader reader)
		{
			_files = new List<ChangedFile>();
			var count = reader.ReadInt32();
			for (int i = 0; i < count; i++)
			{
				var file = new ChangedFile();
				file.SetDataFrom(reader);
				_files.Add(file);
			}
		}
Ejemplo n.º 4
0
        public void SetDataFrom(BinaryReader reader)
        {
            _files = new List <ChangedFile>();
            var count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var file = new ChangedFile();
                file.SetDataFrom(reader);
                _files.Add(file);
            }
        }
        public void Should_never_handle_realtime_tests()
        {
            var project = new Project("", new ProjectDocument(ProjectType.VisualBasic));
            var cache = MockRepository.GenerateMock<ICache>();
            var config = MockRepository.GenerateMock<IConfiguration>();
            var file = new ChangedFile(string.Format("TestResources{0}VS2008{0}_rltm_build_fl_Bleh.csproj", Path.DirectorySeparatorChar));
            cache.Stub(c => c.Get<Project>(file.FullName)).Return(null).Repeat.Once();
            cache.Stub(c => c.Get<Project>(file.FullName)).Return(project).Repeat.Once();

            var marker = new ProjectRebuildMarker(cache, config);
            marker.HandleProjects(file);

            cache.AssertWasNotCalled(c => c.Add<Project>(file.FullName));
        }
        public void Should_add_projects_that_doesnt_exist()
        {
            var project = new Project("", new ProjectDocument(ProjectType.VisualBasic));
            var cache = MockRepository.GenerateMock<ICache>();
            var config = MockRepository.GenerateMock<IConfiguration>();
            var file = new ChangedFile(string.Format("TestResources{0}VS2008{0}NUnitTestProjectVisualBasic.vbproj", Path.DirectorySeparatorChar));
            cache.Stub(c => c.Get<Project>(file.FullName)).Return(null).Repeat.Once();
            cache.Stub(c => c.Get<Project>(file.FullName)).Return(project).Repeat.Once();

            var marker = new ProjectRebuildMarker(cache, config);
            marker.HandleProjects(file);

            cache.AssertWasCalled(c => c.Add<Project>(file.FullName));
        }
		public void HandleProjects(ChangedFile file)
		{
            try
            {
                if (file.FullName.Contains("_rltm_build_fl_"))
                    return;
                handleProject(".csproj", file);
                handleProject(".vbproj", file);
                handleProject(".fsproj", file);
            }
            catch (Exception ex)
            {
                Debug.WriteException(ex);
            }
		}
Ejemplo n.º 8
0
		private bool handleProject(string extension, ChangedFile file)
		{
			if (file.Extension.ToLower().Equals(extension))
			{
				var project = _cache.Get<Project>(file.FullName);
                if (project == null)
                {
                    _cache.Add<Project>(file.FullName);
                    project = _cache.Get<Project>(file.FullName);
                }
                else
                {
                    _cache.Reload<Project>(file.FullName);
                    project = _cache.Get<Project>(file.FullName);
                }
				project.Value.RebuildOnNextRun();
				return true;
			}
			return false;
		}
Ejemplo n.º 9
0
		private bool handleProject(string extension, ChangedFile file)
		{
			if (file.Extension.ToLower().Equals(extension))
			{
				var project = _cache.Get<Project>(file.FullName);
                if (project == null)
                {
                    Debug.WriteDebug("Adding and marking project for rebuild " + file.FullName);
                    _cache.Add<Project>(file.FullName);
                    project = _cache.Get<Project>(file.FullName);
                }
                else
                {
                    Debug.WriteDebug("Reloading and marking project for rebuild " + file.FullName);
                    _cache.Reload<Project>(file.FullName);
                    project = _cache.Get<Project>(file.FullName);
                }
                // Remove this for now. I think this was the result of some chicken blood
				//project.Value.RebuildOnNextRun();
				return true;
			}
			return false;
		}
	    public RunStartedMessage(ChangedFile[] files)
        {
            Files = files;
        }
 private void tryCrawl(ChangedFile file)
 {
     _crawler.Crawl(file.FullName);
 }
 public void AddFile(ChangedFile[] files)
 {
     _files.AddRange(files);
 }
 public void AddFile(ChangedFile file)
 {
     _files.Add(file);
 }
Ejemplo n.º 14
0
 public void AddFile(ChangedFile file)
 {
     _files.Add(file);
 }