public void WriteSolutionVersionProperties(SolutionFormatVersion version, Version currVSVersion, Version minVSVersion) { if (version >= SolutionFormatVersion.VS2012) { writer.WriteLine("VisualStudioVersion = {0}", currVSVersion); writer.WriteLine("MinimumVisualStudioVersion = {0}", minVSVersion); } }
internal MSBuildEngineWorker(IMSBuildEngine parentBuildEngine, IProject project, ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, List<string> additionalTargetFiles) { this.parentBuildEngine = parentBuildEngine; this.project = project; this.projectFileName = project.FileName; this.projectMinimumSolutionVersion = project.MinimumSolutionVersion; this.options = options; this.feedbackSink = feedbackSink; this.additionalTargetFiles = additionalTargetFiles; }
internal MSBuildEngineWorker(IMSBuildEngine parentBuildEngine, IProject project, ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, List <string> additionalTargetFiles) { this.parentBuildEngine = parentBuildEngine; this.project = project; this.projectFileName = project.FileName; this.projectMinimumSolutionVersion = project.MinimumSolutionVersion; this.options = options; this.feedbackSink = feedbackSink; this.additionalTargetFiles = additionalTargetFiles; }
void ParseContent() { var lines = _file.ReadString().Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < lines.Length; i++) { _content.Add( SolutionFormatVersion.TryParse(lines, ref i) ?? SolutionVisualStudioVersion.TryParse(lines, ref i) ?? SolutionProjectReference.TryParse(_file.FileSystem, lines, ref i) ?? Global.TryParse(lines, ref i) ?? (object)lines[i] ); } }
SolutionFormatVersion ComputeSolutionVersion() { SolutionFormatVersion version = SolutionFormatVersion.VS2005; foreach (var project in this.Projects) { if (project.MinimumSolutionVersion > version) { version = project.MinimumSolutionVersion; } } if ((minVSVersion != null || currVSVersion != null) && version < SolutionFormatVersion.VS2012) { version = SolutionFormatVersion.VS2012; } return(version); }
public MSBuildFileProject(ProjectLoadInformation information) : base(information) { try { using (XmlReader r = XmlReader.Create(information.FileName, new XmlReaderSettings { IgnoreComments = true, XmlResolver = null })) { if (r.Read() && r.MoveToContent() == XmlNodeType.Element) { string toolsVersion = r.GetAttribute("ToolsVersion"); Version v; if (Version.TryParse(toolsVersion, out v)) { if (v >= new Version(4, 0)) { minimumSolutionVersion = SolutionFormatVersion.VS2010; // use 4.0 Build Worker } } } } } catch (XmlException) { } catch (IOException) { } }
public void WriteFormatHeader(SolutionFormatVersion version) { writer.WriteLine(); writer.WriteLine("Microsoft Visual Studio Solution File, Format Version " + (int)version + ".00"); switch (version) { case SolutionFormatVersion.VS2005: writer.WriteLine("# Visual Studio 2005"); break; case SolutionFormatVersion.VS2008: writer.WriteLine("# Visual Studio 2008"); break; case SolutionFormatVersion.VS2010: writer.WriteLine("# Visual Studio 2010"); break; case SolutionFormatVersion.VS2012: writer.WriteLine("# Visual Studio 2012"); break; } writer.WriteLine("# SharpDevelop " + RevisionClass.Major + "." + RevisionClass.Minor); }
public MSBuildFileProject(ProjectLoadInformation information) : base(information) { try { using (XmlReader r = XmlReader.Create(information.FileName, new XmlReaderSettings { IgnoreComments = true, XmlResolver = null })) { if (r.Read() && r.MoveToContent() == XmlNodeType.Element) { string toolsVersion = r.GetAttribute("ToolsVersion"); Version v; if (Version.TryParse(toolsVersion, out v)) { if (v >= new Version(4, 0)) { minimumSolutionVersion = SolutionFormatVersion.VS2010; // use 4.0 Build Worker } } } } } catch (XmlException ex) { throw new ProjectLoadException(ex.Message, ex); } // IOException can also occur, but doesn't need to be converted to ProjectLoadException }