|
|
|
@ -2,9 +2,9 @@
@@ -2,9 +2,9 @@
|
|
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Threading.Tasks; |
|
|
|
|
using ICSharpCode.Core; |
|
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
|
using System.Xml; |
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.SharpDevelop.Project |
|
|
|
|
{ |
|
|
|
@ -13,8 +13,29 @@ namespace ICSharpCode.SharpDevelop.Project
@@ -13,8 +13,29 @@ namespace ICSharpCode.SharpDevelop.Project
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class MSBuildFileProject : AbstractProject |
|
|
|
|
{ |
|
|
|
|
SolutionFormatVersion minimumSolutionVersion = SolutionFormatVersion.VS2005; |
|
|
|
|
|
|
|
|
|
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 override SolutionFormatVersion MinimumSolutionVersion { |
|
|
|
|
get { return minimumSolutionVersion; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override Task<bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor) |
|
|
|
|