Exemplo n.º 1
0
		public BooProject(IMSBuildEngineProvider provider, string fileName, string projectName)
			: base(provider)
		{
			this.Name = projectName;
			Init();
			LoadProject(fileName);
		}
Exemplo n.º 2
0
 public BooProject(IMSBuildEngineProvider provider, string fileName, string projectName)
     : base(provider)
 {
     this.Name = projectName;
     Init();
     LoadProject(fileName);
 }
Exemplo n.º 3
0
        public static IProject LoadProject(IMSBuildEngineProvider provider, string location, string title, string projectTypeGuid)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (location == null)
            {
                throw new ArgumentNullException("location");
            }
            if (title == null)
            {
                throw new ArgumentNullException("title");
            }
            if (projectTypeGuid == null)
            {
                throw new ArgumentNullException("projectTypeGuid");
            }

            IProject newProject;

            if (!File.Exists(location))
            {
                newProject          = new MissingProject(location, title);
                newProject.TypeGuid = projectTypeGuid;
            }
            else
            {
                ILanguageBinding binding = LanguageBindingService.GetBindingPerProjectFile(location);
                if (binding != null)
                {
                    try {
                        location = Path.GetFullPath(location);
                    } catch (Exception) {}
                    try {
                        newProject = binding.LoadProject(provider, location, title);
                    } catch (XmlException ex) {
                        newProject          = new UnknownProject(location, title, ex.Message, true);
                        newProject.TypeGuid = projectTypeGuid;
                    } catch (Microsoft.Build.BuildEngine.InvalidProjectFileException ex) {
                        newProject          = new UnknownProject(location, title, ex.Message, true);
                        newProject.TypeGuid = projectTypeGuid;
                    } catch (UnauthorizedAccessException ex) {
                        newProject          = new UnknownProject(location, title, ex.Message, true);
                        newProject.TypeGuid = projectTypeGuid;
                    }
                }
                else
                {
                    newProject          = new UnknownProject(location, title);
                    newProject.TypeGuid = projectTypeGuid;
                }
            }
            return(newProject);
        }
		public static IProject LoadProject(IMSBuildEngineProvider provider, string location, string title, string projectTypeGuid)
		{
			if (provider == null)
				throw new ArgumentNullException("provider");
			if (location == null)
				throw new ArgumentNullException("location");
			if (title == null)
				throw new ArgumentNullException("title");
			if (projectTypeGuid == null)
				throw new ArgumentNullException("projectTypeGuid");
			
			IProject newProject;
			if (!File.Exists(location)) {
				newProject = new MissingProject(location, title);
				newProject.TypeGuid = projectTypeGuid;
			} else {
				ILanguageBinding binding = LanguageBindingService.GetBindingPerProjectFile(location);
				if (binding != null) {
					try {
						location = Path.GetFullPath(location);
					} catch (Exception) {}
					try {
						newProject = binding.LoadProject(provider, location, title);
					} catch (XmlException ex) {
						newProject = new UnknownProject(location, title, ex.Message, true);
						newProject.TypeGuid = projectTypeGuid;
					} catch (Microsoft.Build.BuildEngine.InvalidProjectFileException ex) {
						newProject = new UnknownProject(location, title, ex.Message, true);
						newProject.TypeGuid = projectTypeGuid;
					} catch (UnauthorizedAccessException ex) {
						newProject = new UnknownProject(location, title, ex.Message, true);
						newProject.TypeGuid = projectTypeGuid;
					}
				} else {
					newProject = new UnknownProject(location, title);
					newProject.TypeGuid = projectTypeGuid;
				}
			}
			return newProject;
		}
		public static IProject LoadProject(IMSBuildEngineProvider provider, string location, string title)
		{
			return LoadProject(provider, location, title, "{" + Guid.Empty.ToString() + "}");
		}
		public IProject LoadProject(IMSBuildEngineProvider provider, string fileName, string projectName)
		{
			return new BooProject(provider, fileName, projectName);
		}
Exemplo n.º 7
0
        public static IProject LoadProject(IMSBuildEngineProvider provider, string location, string title, string projectTypeGuid, IProgressMonitor progressMonitor)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (location == null)
            {
                throw new ArgumentNullException("location");
            }
            if (title == null)
            {
                throw new ArgumentNullException("title");
            }
            if (projectTypeGuid == null)
            {
                throw new ArgumentNullException("projectTypeGuid");
            }

            if (progressMonitor != null)
            {
                progressMonitor.BeginTask("Loading " + title, 0, false);
            }

            IProject newProject;

            if (!File.Exists(location))
            {
                newProject          = new MissingProject(location, title);
                newProject.TypeGuid = projectTypeGuid;
            }
            else
            {
                ILanguageBinding binding = LanguageBindingService.GetBindingPerProjectFile(location);
                if (binding != null)
                {
                    location = FileUtility.NormalizePath(location);
                    try {
                        newProject = binding.LoadProject(provider, location, title);
                    } catch (ProjectLoadException ex) {
                        LoggingService.Warn("Project load error", ex);
                        if (progressMonitor != null)
                        {
                            progressMonitor.ShowingDialog = true;
                        }
                        newProject          = new UnknownProject(location, title, ex.Message, true);
                        newProject.TypeGuid = projectTypeGuid;
                        if (progressMonitor != null)
                        {
                            progressMonitor.ShowingDialog = false;
                        }
                    } catch (UnauthorizedAccessException ex) {
                        LoggingService.Warn("Project load error", ex);
                        if (progressMonitor != null)
                        {
                            progressMonitor.ShowingDialog = true;
                        }
                        newProject          = new UnknownProject(location, title, ex.Message, true);
                        newProject.TypeGuid = projectTypeGuid;
                        if (progressMonitor != null)
                        {
                            progressMonitor.ShowingDialog = false;
                        }
                    }
                }
                else
                {
                    string ext = Path.GetExtension(location);
                    if (".proj".Equals(ext, StringComparison.OrdinalIgnoreCase) ||
                        ".build".Equals(ext, StringComparison.OrdinalIgnoreCase))
                    {
                        newProject          = new MSBuildFileProject(location, title);
                        newProject.TypeGuid = projectTypeGuid;
                    }
                    else
                    {
                        newProject          = new UnknownProject(location, title);
                        newProject.TypeGuid = projectTypeGuid;
                    }
                }
            }
            return(newProject);
        }
Exemplo n.º 8
0
 public static IProject LoadProject(IMSBuildEngineProvider provider, string location, string title)
 {
     return(LoadProject(provider, location, title, "{" + Guid.Empty.ToString() + "}", null));
 }
Exemplo n.º 9
0
 public FSharpProject(IMSBuildEngineProvider engineProvider, string fileName, string projectName) : base(engineProvider)
 {
     this.Name = projectName;
     this.LoadProject(fileName);
 }
Exemplo n.º 10
0
 public IProject LoadProject(IMSBuildEngineProvider provider, string fileName, string projectName)
 {
     return(new BooProject(provider, fileName, projectName));
 }
 public IProject LoadProject(IMSBuildEngineProvider engineProvider, string fileName, string projectName)
 {
     return(new CSharpProject(engineProvider, fileName, projectName));
 }
		public static IProject ConvertOldProject(string fileName, Conversion conversion, IMSBuildEngineProvider provider)
		{
			string convertedFileName;
			if (conversion.IsVisualBasic)
				convertedFileName = Path.ChangeExtension(fileName, ".vbproj");
			else
				convertedFileName = Path.ChangeExtension(fileName, ".csproj");
			
			conversion.basePath = Path.GetDirectoryName(fileName);
			using (StreamReader fileReader = new StreamReader(fileName)) {
				RunConverter(fileReader, convertedFileName, "CSharp_prjx2csproj.xsl", conversion);
			}
			using (StreamReader fileReader = new StreamReader(fileName)) {
				RunConverter(fileReader, convertedFileName + ".user", "CSharp_prjx2csproj_user.xsl", conversion);
			}
			
			return LanguageBindingService.LoadProject(provider, convertedFileName, Conversion.GetProjectName(fileName));
		}
		public IProject LoadProject(IMSBuildEngineProvider engineProvider, string fileName, string projectName)
		{
			return new CSharpProject(engineProvider, fileName, projectName);
		}
Exemplo n.º 14
0
 protected CompilableProject(IMSBuildEngineProvider engineProvider)
     : base(engineProvider.BuildEngine)
 {
 }
        public static IProject ConvertOldProject(string fileName, Conversion conversion, IMSBuildEngineProvider provider)
        {
            string convertedFileName;

            if (conversion.IsVisualBasic)
            {
                convertedFileName = Path.ChangeExtension(fileName, ".vbproj");
            }
            else
            {
                convertedFileName = Path.ChangeExtension(fileName, ".csproj");
            }

            conversion.basePath = Path.GetDirectoryName(fileName);
            using (StreamReader fileReader = new StreamReader(fileName)) {
                RunConverter(fileReader, convertedFileName, "CSharp_prjx2csproj.xsl", conversion);
            }
            using (StreamReader fileReader = new StreamReader(fileName)) {
                RunConverter(fileReader, convertedFileName + ".user", "CSharp_prjx2csproj_user.xsl", conversion);
            }

            return(LanguageBindingService.LoadProject(provider, convertedFileName, Conversion.GetProjectName(fileName)));
        }
Exemplo n.º 16
0
		public WixProject(IMSBuildEngineProvider provider, string fileName, string projectName)
			: base(provider)
		{
			Name = projectName;
			LoadProject(fileName);
		}
		public static IProject LoadProject(IMSBuildEngineProvider provider, string location, string title, string projectTypeGuid, IProgressMonitor progressMonitor)
		{
			if (provider == null)
				throw new ArgumentNullException("provider");
			if (location == null)
				throw new ArgumentNullException("location");
			if (title == null)
				throw new ArgumentNullException("title");
			if (projectTypeGuid == null)
				throw new ArgumentNullException("projectTypeGuid");
			
			if (progressMonitor != null) {
				progressMonitor.BeginTask("Loading " + title, 0, false);
			}
			
			IProject newProject;
			if (!File.Exists(location)) {
				newProject = new MissingProject(location, title);
				newProject.TypeGuid = projectTypeGuid;
			} else {
				ILanguageBinding binding = LanguageBindingService.GetBindingPerProjectFile(location);
				if (binding != null) {
					location = FileUtility.NormalizePath(location);
					try {
						newProject = binding.LoadProject(provider, location, title);
					} catch (ProjectLoadException ex) {
						LoggingService.Warn("Project load error", ex);
						if (progressMonitor != null) progressMonitor.ShowingDialog = true;
						newProject = new UnknownProject(location, title, ex.Message, true);
						newProject.TypeGuid = projectTypeGuid;
						if (progressMonitor != null) progressMonitor.ShowingDialog = false;
					} catch (UnauthorizedAccessException ex) {
						LoggingService.Warn("Project load error", ex);
						if (progressMonitor != null) progressMonitor.ShowingDialog = true;
						newProject = new UnknownProject(location, title, ex.Message, true);
						newProject.TypeGuid = projectTypeGuid;
						if (progressMonitor != null) progressMonitor.ShowingDialog = false;
					}
				} else {
					string ext = Path.GetExtension(location);
					if (".proj".Equals(ext, StringComparison.OrdinalIgnoreCase)
					    || ".build".Equals(ext, StringComparison.OrdinalIgnoreCase))
					{
						newProject = new MSBuildFileProject(location, title);
						newProject.TypeGuid = projectTypeGuid;
					} else {
						newProject = new UnknownProject(location, title);
						newProject.TypeGuid = projectTypeGuid;
					}
				}
			}
			return newProject;
		}
Exemplo n.º 18
0
 public RubyProject(IMSBuildEngineProvider provider, string fileName, string projectName)
     : base(provider)
 {
     Name = projectName;
     LoadProject(fileName);
 }
Exemplo n.º 19
0
		protected CompilableProject(IMSBuildEngineProvider engineProvider)
			: base(engineProvider.BuildEngine)
		{
		}