Author: ankit
Date: 2007-09-27 08:54:29 -0400 (Thu, 27 Sep 2007)
New Revision: 86490

Added:
   trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetMSBuildProjectExtension.cs
Modified:
   trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml
   trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp
   trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
   trunk/monodevelop/Extras/AspNetAddIn/Makefile.am
Log:
Add support for VS2005 WebApplication projects.
* Project/AspNetMSBuildProjectExtension.cs: New.
* AspNetAddIn.addin.xml: Add Extension.
* AspNetAddIn.mdp: Update.
* Makefile.am: Update.


Modified: trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml  2007-09-27 
12:43:57 UTC (rev 86489)
+++ trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml  2007-09-27 
12:54:29 UTC (rev 86490)
@@ -21,6 +21,7 @@
                <Addin id="SourceEditor" version="0.16.0"/>
                <Addin id="DesignerSupport" version="0.16.0"/>
                <Addin id="Deployment" version="0.16.0"/>
+               <Addin id="Prj2Make" version="0.16.0" />
        </Dependencies>
 
        <Extension path = "/MonoDevelop/Ide/FileTemplates">
@@ -120,7 +121,11 @@
        <Extension path = "/MonoDevelop/ProjectModel/ProjectServiceExtensions">
                <Class class = "AspNetAddIn.VerifyCodeBehindBuildStep" />
        </Extension>
-       
+
+       <Extension path = "/MonoDevelop/Prj2Make/MSBuildProjectExtension">
+               <Class class="AspNetAddIn.AspNetMSBuildProjectExtension" />
+       </Extension>
+
        <Extension path = "/MonoDevelop/Ide/Commands">
                <Category _name = "ASP.NET" id = "AspNet">
                <Command id = "AspNetAddIn.AspNetCommands.AddAspNetDirectory"

Modified: trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp        2007-09-27 
12:43:57 UTC (rev 86489)
+++ trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp        2007-09-27 
12:54:29 UTC (rev 86490)
@@ -79,6 +79,7 @@
     <File name="./Project/AspNetCommands.cs" subtype="Code" 
buildaction="Compile" />
     <File name="./gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs" subtype="Code" 
buildaction="Compile" />
     <File name="./Gui/XspOptionsPanelWidget.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./Project/AspNetMSBuildProjectExtension.cs" subtype="Code" 
buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" 
refto="MonoDevelop.Components" />
@@ -101,6 +102,7 @@
     <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Project" localcopy="False" refto="Mono.Addins" />
+    <ProjectReference type="Project" localcopy="False" 
refto="prj2make-sharp-lib" />
   </References>
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" 
RelativeMakefileName="./Makefile.am" BuildTargetName="" CleanTargetName="" 
SyncReferences="True" IsAutotoolsProject="True" 
RelativeConfigureInPath="../../">
     <BuildFilesVar Sync="True" Name="FILES" />

Modified: trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/ChangeLog      2007-09-27 12:43:57 UTC 
(rev 86489)
+++ trunk/monodevelop/Extras/AspNetAddIn/ChangeLog      2007-09-27 12:54:29 UTC 
(rev 86490)
@@ -1,3 +1,11 @@
+2007-09-27  Ankit Jain  <[EMAIL PROTECTED]>
+
+       Add support for VS2005 WebApplication projects.
+       * Project/AspNetMSBuildProjectExtension.cs: New.
+       * AspNetAddIn.addin.xml: Add Extension.
+       * AspNetAddIn.mdp: Update.
+       * Makefile.am: Update.
+
 2007-09-21  Michael Hutchinson <[EMAIL PROTECTED]> 
 
        * Project/AspNetAppProject.cs: Make write-safe by using TextFile API 
rather

Modified: trunk/monodevelop/Extras/AspNetAddIn/Makefile.am
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Makefile.am    2007-09-27 12:43:57 UTC 
(rev 86489)
+++ trunk/monodevelop/Extras/AspNetAddIn/Makefile.am    2007-09-27 12:54:29 UTC 
(rev 86490)
@@ -7,6 +7,7 @@
        -r:$(top_builddir)/build/AddIns/MonoDevelop.Deployment.dll \
        
-r:$(top_builddir)/build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll
 \
        -r:$(top_builddir)/build/AddIns/MonoDevelop.SourceEditor.dll \
+       -r:$(top_builddir)/build/AddIns/prj2makesharp/prj2make-sharp-lib.dll \
        -r:$(top_builddir)/build/bin/Mono.Addins.dll \
        -r:$(top_builddir)/build/bin/MonoDevelop.Components.dll \
        -r:$(top_builddir)/build/bin/MonoDevelop.Core.dll \
@@ -58,6 +59,7 @@
        Project/AspNetCommands.cs \
        Project/AspNetDisplayBinding.cs \
        Project/AspNetFileDescriptionTemplate.cs \
+       Project/AspNetMSBuildProjectExtension.cs \
        Project/CodeBehind.cs \
        Project/ProjectFolderNodeBuilderExtension.cs \
        Project/VerifyCodeBehindBuildStep.cs \

Added: 
trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetMSBuildProjectExtension.cs
===================================================================
--- 
trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetMSBuildProjectExtension.cs   
    2007-09-27 12:43:57 UTC (rev 86489)
+++ 
trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetMSBuildProjectExtension.cs   
    2007-09-27 12:54:29 UTC (rev 86490)
@@ -0,0 +1,125 @@
+//
+// AspNetMSBuildProjectExtension.cs
+//
+// Author:
+//   Ankit Jain <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Xml;
+
+using MonoDevelop.Prj2Make;
+using MonoDevelop.Projects;
+
+namespace AspNetAddIn
+{
+       public class AspNetMSBuildProjectExtension : MSBuildProjectExtension
+       {
+               const string myguid = "{349C5851-65DF-11DA-9384-00065B846F21}";
+
+               public override string TypeGuid {
+                       get { return myguid; }
+               }
+
+               public override string Name {
+                       get { return "AspNet";}
+               }
+
+               public override bool Supports (string type_guid, string 
filename, string type_guids)
+               {
+                       return (String.Compare (type_guid, myguid, true) == 0);
+               }
+
+               public override DotNetProject CreateProject (string type_guid, 
string filename, string type_guids)
+               {
+                       if (!Supports (type_guid, filename, type_guids))
+                               throw new InvalidOperationException 
(String.Format ("Project of type guid = {0} not supported by this extension.", 
type_guid));
+
+                       string lang = Utils.GetLanguage (filename);
+                       //if (lang == null)
+                       return new AspNetAppProject (lang);
+               }
+
+               public override void ReadFlavorProperties (MSBuildData data, 
DotNetProject project, XmlNode node, string guid)
+               {
+                       if (String.Compare (guid, myguid, true) != 0) {
+                               base.ReadFlavorProperties (data, project, node, 
guid);
+                               return;
+                       }
+
+                       AspNetAppProject asp_project = (AspNetAppProject) 
project;
+
+                       //FlavorProperties for web project
+                       if (node == null)
+                               return;
+                       node = Utils.MoveToChild (node, "WebProjectProperties");
+                       if (node == null)
+                               return;
+
+                       //Read
+                       int port = -1;
+                       if (!Utils.ReadAsInt (node, "DevelopmentServerPort", 
ref port) || port < 0)
+                               return;
+
+                       asp_project.XspParameters.Port = port;
+               }
+
+               //Writing methods
+
+               public override void OnFinishWrite (MSBuildData data, 
DotNetProject project)
+               {
+                       base.OnFinishWrite (data, project);
+
+                       if (!project.ExtendedProperties.Contains (typeof 
(MSBuildFileFormat))) {
+                               //New project file, eg when converting from 
another project
+                               XmlElement elem = data.Document.CreateElement 
("Import", Utils.ns);
+                               data.Document.DocumentElement.InsertAfter 
(elem, data.Document.DocumentElement.LastChild);
+                               elem.SetAttribute ("Project", 
@"$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets");
+                       }
+
+                       // insert this at the end
+                       XmlElement flavor_properties_element = 
MSBuildFileFormat.GetFlavorPropertiesElement (data, myguid, true);
+                       XmlNode webproject_element = Utils.MoveToChild 
(flavor_properties_element, "WebProjectProperties");
+                       if (webproject_element == null) {
+                               webproject_element = 
data.Document.CreateElement ("WebProjectProperties", Utils.ns);
+                               flavor_properties_element.AppendChild 
(webproject_element);
+                       }
+
+                       AspNetAppProject asp_project = (AspNetAppProject) 
project;
+                       Utils.EnsureChildValue (webproject_element, 
"DevelopmentServerPort", asp_project.XspParameters.Port);
+               }
+
+               public override string GetGuidChain (DotNetProject project)
+               {
+                       if (project.GetType () != typeof (AspNetAppProject))
+                               return null;
+
+                       if (!MSBuildFileFormat.ProjectTypeGuids.ContainsKey 
(project.LanguageName))
+                               return null;
+
+                       return String.Format ("{0};{1}", myguid, 
MSBuildFileFormat.ProjectTypeGuids [project.LanguageName]);
+               }
+       }
+
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to