diff options
author | Matt Ward <matt.ward@xamarin.com> | 2017-01-24 14:14:14 +0300 |
---|---|---|
committer | Matt Ward <matt.ward@xamarin.com> | 2017-01-24 14:14:14 +0300 |
commit | bcfb3dadce6260926a44f7bb51302ecb888cf485 (patch) | |
tree | 6b601069c005d3106b1cba315226f7d2dda8f26d | |
parent | be427b05f70979638aef7c859d549c3a7e9c623a (diff) |
[Autotools] Use MSBuildProject's Namespace for make file data
When adding make file data into the project file the MSBuildProject's
Namespace is now used instead of the Schema constant. This allows the
project to have a different namespace and prevents an xmlns attribute
being added for Sdk style projects.
-rw-r--r-- | main/src/addins/MonoDevelop.Autotools/MakefileData.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileData.cs b/main/src/addins/MonoDevelop.Autotools/MakefileData.cs index 01b78a04dc..73ae0e9219 100644 --- a/main/src/addins/MonoDevelop.Autotools/MakefileData.cs +++ b/main/src/addins/MonoDevelop.Autotools/MakefileData.cs @@ -81,8 +81,18 @@ namespace MonoDevelop.Autotools public XmlElement Write () { + string xmlns = MSBuildProject.Schema; + var msbuildProject = ownerProject?.MSBuildProject; + if (msbuildProject != null) + xmlns = msbuildProject.Namespace; + + return Write (xmlns); + } + + XmlElement Write (string xmlns) + { XmlDataSerializer ser = new XmlDataSerializer (new DataContext ()); - ser.Namespace = MSBuildProject.Schema; + ser.Namespace = xmlns; var sw = new StringWriter (); ser.Serialize (new XmlTextWriter (sw), this); XmlDocument doc = new XmlDocument (); |