Author: lluis
Date: 2007-03-29 12:04:05 -0500 (Thu, 29 Mar 2007)
New Revision: 75156

Added:
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/IFileCopyHandler.cs
Removed:
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployHandler.cs
Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog
   trunk/monodevelop/Core/src/MonoDevelop.Projects/Makefile.am
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployTarget.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployService.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployTarget.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/FileCopyHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployTarget.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml
   trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.mdp
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
Log:
* MonoDevelop.Projects/CombineEntry.cs, MonoDevelop.Projects.addin.xml,
  MonoDevelop.Projects.Deployment/DeployService.cs,
  MonoDevelop.Projects.Deployment/InstallDeployHandler.cs,
  MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs,
  MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs,
  MonoDevelop.Projects.Deployment/InstallDeployTarget.cs,
  MonoDevelop.Projects.Deployment/CommandDeployTarget.cs,
  MonoDevelop.Projects.Deployment/DeployTarget.cs,
  MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs,
  MonoDevelop.Projects.Deployment/FileCopyHandler.cs: Simplified a
  bit the deployment api. IDeployHandler is not needed anymore.
* MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs: Moved
  to Deployment dir.
* MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs,
  MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs,
  MonoDevelop.Projects.Deployment/CommandDeployHandler.cs,
  MonoDevelop.Projects.Deployment/DeployHandler.cs,
  MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs: Removed.
* MonoDevelop.Projects.mdp, Makefile.am: Updated.

Modified: trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog   2007-03-29 
17:01:33 UTC (rev 75155)
+++ trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog   2007-03-29 
17:04:05 UTC (rev 75156)
@@ -1,5 +1,27 @@
 2007-03-29  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
 
+       * MonoDevelop.Projects/CombineEntry.cs, MonoDevelop.Projects.addin.xml,
+         MonoDevelop.Projects.Deployment/DeployService.cs,
+         MonoDevelop.Projects.Deployment/InstallDeployHandler.cs,
+         MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs,
+         MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs,
+         MonoDevelop.Projects.Deployment/InstallDeployTarget.cs,
+         MonoDevelop.Projects.Deployment/CommandDeployTarget.cs,
+         MonoDevelop.Projects.Deployment/DeployTarget.cs,
+         MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs,
+         MonoDevelop.Projects.Deployment/FileCopyHandler.cs: Simplified a
+         bit the deployment api. IDeployHandler is not needed anymore.
+       * MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs: Moved
+         to Deployment dir.
+       * MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs,
+         MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs,
+         MonoDevelop.Projects.Deployment/CommandDeployHandler.cs,
+         MonoDevelop.Projects.Deployment/DeployHandler.cs,
+         MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs: Removed.
+       * MonoDevelop.Projects.mdp, Makefile.am: Updated.
+
+2007-03-29  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
+
        * MonoDevelop.Projects/ProjectService.cs: Track api changes.
        * MonoDevelop.Projects/FileFormatManager.cs: Allow getting all file
          formats supported by a file or object.

Modified: trunk/monodevelop/Core/src/MonoDevelop.Projects/Makefile.am
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Projects/Makefile.am 2007-03-29 
17:01:33 UTC (rev 75155)
+++ trunk/monodevelop/Core/src/MonoDevelop.Projects/Makefile.am 2007-03-29 
17:04:05 UTC (rev 75156)
@@ -24,22 +24,16 @@
        MonoDevelop.Projects.CodeGeneration/RefactorerContext.cs \
        MonoDevelop.Projects.CodeGeneration/RefactorOperations.cs \
        MonoDevelop.Projects.CodeGeneration/XmlCodeDomReader.cs \
-       MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs \
-       MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs \
-       MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs \
        MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs \
-       MonoDevelop.Projects.Deployment/CommandDeployHandler.cs \
        MonoDevelop.Projects.Deployment/CommandDeployTarget.cs \
        MonoDevelop.Projects.Deployment/DeployFile.cs \
-       MonoDevelop.Projects.Deployment/DeployHandler.cs \
        MonoDevelop.Projects.Deployment/DeployService.cs \
        MonoDevelop.Projects.Deployment/DeployTarget.cs \
-       MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs \
        MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs \
        MonoDevelop.Projects.Deployment/FileCopyConfiguration.cs \
        MonoDevelop.Projects.Deployment/FileCopyHandler.cs \
+       MonoDevelop.Projects.Deployment/IFileCopyHandler.cs \
        MonoDevelop.Projects.Deployment/IFileReplacePolicy.cs \
-       MonoDevelop.Projects.Deployment/InstallDeployHandler.cs \
        MonoDevelop.Projects.Deployment/InstallDeployTarget.cs \
        MonoDevelop.Projects.Deployment/LocalFileCopyConfiguration.cs \
        MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs \

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
        2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
        2007-03-29 17:04:05 UTC (rev 75156)
@@ -248,7 +248,7 @@
                public DeployTargetCollection DeployTargets {
                        get { 
                                if (deployTargets == null)
-                                       deployTargets = new 
DeployTargetCollection ();
+                                       deployTargets = new 
DeployTargetCollection (this);
                                return deployTargets;
                        }
                }
@@ -275,10 +275,6 @@
                        handler.Deserialize (this, data);
                        if (ac != null)
                                activeConfiguration = GetConfiguration 
(ac.Value);
-                               
-                       if (deployTargets != null)
-                               foreach (DeployTarget target in deployTargets)
-                                       target.SetCombineEntry (this);
                }
                
                public abstract IConfiguration CreateConfiguration (string 
name);

Deleted: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs
    2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs
    2007-03-29 17:04:05 UTC (rev 75156)
@@ -1,80 +0,0 @@
-//
-// CombinedDeployHandler.cs
-//
-// Author:
-//   Lluis Sanchez Gual
-//
-// 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 MonoDevelop.Core;
-using MonoDevelop.Projects.Deployment.Extensions;
-
-namespace MonoDevelop.Projects.Deployment
-{
-       public class CombinedDeployHandler: IDeployHandler
-       {
-               public string Id {
-                       get { return "MonoDevelop.CombinedDeploy"; }
-               }
-               
-               public string Description {
-                       get { return GettextCatalog.GetString ("Combined 
Deploy"); }
-               }
-               
-               public string Icon {
-                       get { return "gtk-execute"; }
-               }
-               
-               public bool CanDeploy (CombineEntry entry)
-               {
-                       return true;
-               }
-               
-               public DeployTarget CreateTarget (CombineEntry entry)
-               {
-                       return new CombinedDeployTarget ();
-               }
-               
-               public void Deploy (IProgressMonitor monitor, DeployTarget 
target)
-               {
-                       CombinedDeployTarget t = (CombinedDeployTarget) target;
-                       
-                       monitor.BeginTask ("", t.DeployTargets.Count);
-                       foreach (DeployTarget dt in t.DeployTargets) {
-                               try {
-                                       dt.Deploy (monitor);
-                                       if (monitor.IsCancelRequested)
-                                               break;
-                               }
-                               catch (Exception ex) {
-                                       monitor.ReportError ("Deploy operation 
failed", ex);
-                                       break;
-                               }
-                               monitor.Step (1);
-                       }
-                       monitor.EndTask ();
-               }
-       }
-}

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs
     2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs
     2007-03-29 17:04:05 UTC (rev 75156)
@@ -31,6 +31,8 @@
 using System.Collections.Generic;
 using MonoDevelop.Projects;
 using MonoDevelop.Projects.Serialization;
+using MonoDevelop.Core;
+using System.Collections.Specialized;
 
 namespace MonoDevelop.Projects.Deployment
 {
@@ -43,11 +45,19 @@
                        targets = new List<DeployTarget> ();
                }
                
+               public override string Description {
+                       get { return GettextCatalog.GetString ("Combined 
Deploy"); }
+               }
+               
+               public override string Icon {
+                       get { return "gtk-execute"; }
+               }
+               
                [ItemProperty]
                public List<DeployTarget> DeployTargets {
                        get {
                                foreach (DeployTarget t in targets)
-                                       t.SetCombineEntry (base.CombineEntry);
+                                       t.CombineEntry = base.CombineEntry;
                                return targets;
                        }
                }
@@ -62,5 +72,23 @@
                                        targets.Add (dt.Clone ());
                        }
                }
+               
+               protected override void OnDeploy (IProgressMonitor monitor)
+               {
+                       monitor.BeginTask ("", DeployTargets.Count);
+                       foreach (DeployTarget dt in DeployTargets) {
+                               try {
+                                       dt.Deploy (monitor);
+                                       if (monitor.IsCancelRequested)
+                                               break;
+                               }
+                               catch (Exception ex) {
+                                       monitor.ReportError ("Deploy operation 
failed", ex);
+                                       break;
+                               }
+                               monitor.Step (1);
+                       }
+                       monitor.EndTask ();
+               }
        }
 }

Deleted: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployHandler.cs
     2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployHandler.cs
     2007-03-29 17:04:05 UTC (rev 75156)
@@ -1,133 +0,0 @@
-//
-// CommandDeployHandler.cs
-//
-// Author:
-//   Lluis Sanchez Gual
-//
-// 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.IO;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Projects.Deployment.Extensions;
-
-namespace MonoDevelop.Projects.Deployment
-{
-       public class CommandDeployHandler: IDeployHandler
-       {
-               public string Id {
-                       get { return "MonoDevelop.CommandDeploy"; }
-               }
-               
-               public string Description {
-                       get { return GettextCatalog.GetString ("Execute 
command"); }
-               }
-               
-               public string Icon {
-                       get { return "gtk-execute"; }
-               }
-               
-               public bool CanDeploy (CombineEntry entry)
-               {
-                       return true;
-               }
-               
-               public DeployTarget CreateTarget (CombineEntry entry)
-               {
-                       return new CommandDeployTarget ();
-               }
-               
-               public void Deploy (IProgressMonitor monitor, DeployTarget 
target)
-               {
-                       CommandDeployTarget t = (CommandDeployTarget) target;
-                       string consMsg;
-                       IConsole cons;
-                       if (t.ExternalConsole) {
-                               cons = 
ExternalConsoleFactory.Instance.CreateConsole (t.CloseConsoleWhenDone);
-                               consMsg = GettextCatalog.GetString ("(in 
external terminal)");
-                       } else {
-                               cons = new MonitorConsole (monitor);
-                               consMsg = "";
-                       }
-                       
-                       monitor.Log.WriteLine (GettextCatalog.GetString 
("Executing: {0} {1} {2}", t.Command, t.Arguments, consMsg));
-                       ProcessWrapper process = 
Runtime.ProcessService.StartConsoleProcess (t.Command, t.Arguments, 
t.CombineEntry.BaseDirectory, cons, null);
-                       
-                       if (t.ExternalConsole)
-                               process.WaitForExit ();
-                       else
-                               process.WaitForOutput ();
-                       
-                       if (cons is MonitorConsole) {
-                               ((MonitorConsole)cons).Dispose ();
-                       }
-               }
-       }
-       
-       class MonitorConsole: IConsole
-       {
-               StringReader nullReader;
-               IProgressMonitor monitor;
-               
-               public MonitorConsole (IProgressMonitor monitor)
-               {
-                       this.monitor = monitor;
-                       monitor.CancelRequested += OnCancel;
-               }
-               
-               public void Dispose ()
-               {
-                       monitor.CancelRequested -= OnCancel;
-               }
-               
-               void OnCancel (IProgressMonitor monitor)
-               {
-                       if (CancelRequested != null)
-                               CancelRequested (this, EventArgs.Empty);
-               }
-               
-               public TextReader In {
-                       get {
-                               if (nullReader == null)
-                                       nullReader = new StringReader ("");
-                               return nullReader;
-                       }
-               }
-               
-               public TextWriter Out {
-                       get { return monitor.Log; }
-               }
-               
-               public TextWriter Error {
-                       get { return monitor.Log; }
-               }
-               
-               public bool CloseOnDispose {
-                       get { return false; }
-               }
-               
-               public event EventHandler CancelRequested;
-       }
-}

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployTarget.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployTarget.cs
      2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/CommandDeployTarget.cs
      2007-03-29 17:04:05 UTC (rev 75156)
@@ -28,7 +28,10 @@
 
 
 using System;
+using System.IO;
 using MonoDevelop.Projects.Serialization;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
 
 namespace MonoDevelop.Projects.Deployment
 {
@@ -39,6 +42,14 @@
                bool externalConsole;
                bool closeConsoleWhenDone;
                
+               public override string Description {
+                       get { return GettextCatalog.GetString ("Execute 
command"); }
+               }
+               
+               public override string Icon {
+                       get { return "gtk-execute"; }
+               }
+               
                [ItemProperty]
                public string Command {
                        get { return command; }
@@ -74,5 +85,75 @@
                                closeConsoleWhenDone = t.closeConsoleWhenDone;
                        }
                }
+               
+               protected override void OnDeploy (IProgressMonitor monitor)
+               {
+                       string consMsg;
+                       IConsole cons;
+                       if (ExternalConsole) {
+                               cons = 
ExternalConsoleFactory.Instance.CreateConsole (CloseConsoleWhenDone);
+                               consMsg = GettextCatalog.GetString ("(in 
external terminal)");
+                       } else {
+                               cons = new MonitorConsole (monitor);
+                               consMsg = "";
+                       }
+                       
+                       monitor.Log.WriteLine (GettextCatalog.GetString 
("Executing: {0} {1} {2}", Command, Arguments, consMsg));
+                       ProcessWrapper process = 
Runtime.ProcessService.StartConsoleProcess (Command, Arguments, 
CombineEntry.BaseDirectory, cons, null);
+                       
+                       if (ExternalConsole)
+                               process.WaitForExit ();
+                       else
+                               process.WaitForOutput ();
+                       
+                       if (cons is MonitorConsole) {
+                               ((MonitorConsole)cons).Dispose ();
+                       }
+               }
        }
+       
+       class MonitorConsole: IConsole
+       {
+               StringReader nullReader;
+               IProgressMonitor monitor;
+               
+               public MonitorConsole (IProgressMonitor monitor)
+               {
+                       this.monitor = monitor;
+                       monitor.CancelRequested += OnCancel;
+               }
+               
+               public void Dispose ()
+               {
+                       monitor.CancelRequested -= OnCancel;
+               }
+               
+               void OnCancel (IProgressMonitor monitor)
+               {
+                       if (CancelRequested != null)
+                               CancelRequested (this, EventArgs.Empty);
+               }
+               
+               public TextReader In {
+                       get {
+                               if (nullReader == null)
+                                       nullReader = new StringReader ("");
+                               return nullReader;
+                       }
+               }
+               
+               public TextWriter Out {
+                       get { return monitor.Log; }
+               }
+               
+               public TextWriter Error {
+                       get { return monitor.Log; }
+               }
+               
+               public bool CloseOnDispose {
+                       get { return false; }
+               }
+               
+               public event EventHandler CancelRequested;
+       }       
 }

Deleted: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployHandler.cs
    2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployHandler.cs
    2007-03-29 17:04:05 UTC (rev 75156)
@@ -1,75 +0,0 @@
-//
-// DeployHandler.cs
-//
-// Author:
-//   Lluis Sanchez Gual
-//
-// Copyright (C) 2006 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 MonoDevelop.Core;
-using MonoDevelop.Projects.Deployment.Extensions;
-
-namespace MonoDevelop.Projects.Deployment
-{
-       public sealed class DeployHandler
-       {
-               IDeployHandler handler;
-               
-               internal DeployHandler (IDeployHandler handler)
-               {
-                       this.handler = handler;
-               }
-               
-               public string Id {
-                       get { return handler.Id; }
-               }
-               
-               public string Icon {
-                       get { return handler.Icon != null ? handler.Icon : 
"md-package"; }
-               }
-               
-               public string Description { 
-                       get { return handler.Description; } 
-               }
-               
-               public DeployTarget CreateTarget (CombineEntry entry)
-               {
-                       DeployTarget dt = handler.CreateTarget (entry);
-                       dt.Bind (this);
-                       dt.SetCombineEntry (entry);
-                       return dt;
-               }
-               
-               internal bool CanDeploy (CombineEntry entry)
-               {
-                       return handler.CanDeploy (entry);
-               }
-               
-               internal void Deploy (IProgressMonitor monitor, DeployTarget 
target)
-               {
-                       handler.Deploy (monitor, target);
-               }
-       }
-}

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployService.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployService.cs
    2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployService.cs
    2007-03-29 17:04:05 UTC (rev 75156)
@@ -32,13 +32,11 @@
 
 using MonoDevelop.Core;
 using MonoDevelop.Core.AddIns;
-using MonoDevelop.Projects.Deployment.Extensions;
 
 namespace MonoDevelop.Projects.Deployment
 {
        public class DeployService: AbstractService
        {
-               List<DeployHandler> handlers = new List<DeployHandler> ();
                List<FileCopyHandler> copiers = new List<FileCopyHandler> ();
                
                public DeployService()
@@ -48,17 +46,9 @@
                public override void InitializeService()
                {
                        base.InitializeService ();
-                       Runtime.AddInService.RegisterExtensionItemListener 
("/SharpDevelop/Workbench/DeployHandlers", OnHandlerExtensionChanged);
                        Runtime.AddInService.RegisterExtensionItemListener 
("/SharpDevelop/Workbench/DeployFileCopiers", OnCopierExtensionChanged);
                }
                
-               void OnHandlerExtensionChanged (ExtensionAction action, object 
item)
-               {
-                       if (action == ExtensionAction.Add) {
-                               handlers.Add (new DeployHandler 
((IDeployHandler)item));
-                       }
-               }
-               
                void OnCopierExtensionChanged (ExtensionAction action, object 
item)
                {
                        if (action == ExtensionAction.Add) {
@@ -66,25 +56,20 @@
                        }
                }
                
-               public DeployHandler[] GetDeployHandlers (CombineEntry entry)
+               public DeployTarget[] GetSupportedDeployTargets (CombineEntry 
entry)
                {
-                       List<DeployHandler> list = new List<DeployHandler> ();
-                       foreach (DeployHandler handler in handlers)
-                               if (handler.CanDeploy (entry))
-                                       list.Add (handler);
+                       object[] targets = Runtime.AddInService.GetTreeItems 
("/SharpDevelop/Workbench/DeployHandlers");
+                       List<DeployTarget> list = new List<DeployTarget> ();
+                       foreach (DeployTarget target in targets) {
+                               if (target.CanDeploy (entry)) {
+                                       target.CombineEntry = entry;
+                                       list.Add (target);
+                               }
+                       }
 
                        return list.ToArray ();
                }
                
-               internal DeployHandler GetDeployHandler (string id)
-               {
-                       foreach (DeployHandler handler in handlers)
-                               if (handler.Id == id)
-                                       return handler;
-
-                       return null;
-               }
-               
                public FileCopyHandler[] GetFileCopyHandlers ()
                {
                        return copiers.ToArray ();

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployTarget.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployTarget.cs
     2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DeployTarget.cs
     2007-03-29 17:04:05 UTC (rev 75156)
@@ -28,7 +28,7 @@
 
 
 using System;
-using System.Collections.Generic;
+using System.Collections;
 using MonoDevelop.Projects.Serialization;
 using MonoDevelop.Core;
 
@@ -37,11 +37,6 @@
        [DataItem (FallbackType=typeof(UnknownDeployTarget))]
        public class DeployTarget
        {
-               DeployHandler handler;
-               
-               [ItemProperty ("Handler")]
-               string handlerId;
-               
                [ItemProperty ("Name")]
                string name;
                
@@ -51,22 +46,19 @@
                {
                }
                
-               internal void Bind (DeployHandler handler)
-               {
-                       this.handler = handler;
-                       this.handlerId = handler.Id;
+               public virtual string Description {
+                       get { return GettextCatalog.GetString ("Deploy 
Target"); } 
                }
                
-               internal void SetCombineEntry (CombineEntry entry)
-               {
-                       this.entry = entry;
+               public virtual string Icon {
+                       get { return "md-package"; }
                }
                
                public void Deploy (IProgressMonitor monitor)
                {
                        monitor.BeginTask ("Deploy operation: " + Name, 1);
                        try {
-                               this.DeployHandler.Deploy (monitor, this);
+                               OnDeploy (monitor);
                        } catch (Exception ex) {
                                monitor.ReportError ("Deploy operation failed", 
ex);
                                monitor.AsyncOperation.Cancel ();
@@ -75,18 +67,32 @@
                        }
                }
                
+               public virtual bool CanDeploy (CombineEntry entry)
+               {
+                       return true;
+               }
+               
                public string Name {
                        get { return name; }
                        set { name = value; }
                }
                
                public CombineEntry CombineEntry {
-                       get { return entry; }
+                       get {
+                               return entry; 
+                       }
+                       internal set {
+                               if (entry != value) {
+                                       entry = value;
+                                       if (entry != null)
+                                               OnInitialize (entry);
+                               }
+                       }
                }
                
                public DeployTarget Clone ()
                {
-                       DeployTarget d = DeployHandler.CreateTarget (entry);
+                       DeployTarget d = (DeployTarget) 
Activator.CreateInstance (GetType());
                        d.CopyFrom (this);
                        return d;
                }
@@ -94,27 +100,12 @@
                public virtual void CopyFrom (DeployTarget other)
                {
                        name = other.name;
-                       handlerId = other.handlerId;
-                       handler = other.handler;
                        entry = other.entry;
                }
                
-               public DeployHandler DeployHandler {
-                       get {
-                               if (handler == null) {
-                                       if (handlerId == null)
-                                               throw new 
InvalidOperationException ("Deploy target not bound to a handler");
-                                       handler = 
Services.DeployService.GetDeployHandler (handlerId);
-                                       if (handler == null)
-                                               throw new 
InvalidOperationException ("Deploy handler not found: " + handlerId);
-                               }
-                               return handler;
-                       }
-               }
-               
                public virtual string GetDefaultName (CombineEntry entry)
                {
-                       string bname = DeployHandler.Description;
+                       string bname = Description;
                        string name = bname;
                        
                        int n = 2;
@@ -135,9 +126,71 @@
 
                        return name;
                }
+               
+               protected virtual void OnInitialize (CombineEntry entry)
+               {
+               }
+               
+               protected virtual void OnDeploy (IProgressMonitor monitor)
+               {
+                       OnDeployCombineEntry (monitor, entry);
+               }
+               
+               protected virtual void OnDeployCombineEntry (IProgressMonitor 
monitor, CombineEntry entry)
+               {
+                       if (entry is Combine)
+                               OnDeployCombine (monitor, (Combine) entry);
+                       else if (entry is Project)
+                               OnDeployProject (monitor, (Project) entry);
+               }
+               
+               protected virtual void OnDeployCombine (IProgressMonitor 
monitor, Combine combine)
+               {
+                       foreach (CombineEntry e in combine.Entries)
+                               OnDeployCombineEntry (monitor, e);
+               }
+               
+               protected virtual void OnDeployProject (IProgressMonitor 
monitor, Project project)
+               {
+               }
        }
        
-       public class DeployTargetCollection: List<DeployTarget>
+       public class DeployTargetCollection: CollectionBase
        {
+               CombineEntry owner;
+               
+               internal DeployTargetCollection (CombineEntry e)
+               {
+                       owner = e;
+               }
+               
+               public DeployTargetCollection ()
+               {
+               }
+               
+               public void Add (DeployTarget target)
+               {
+                       List.Add (target);
+               }
+               
+               public void AddRange (ICollection col)
+               {
+                       foreach (DeployTarget tar in col)
+                               Add (tar);
+               }
+               
+               public DeployTarget this [int n] {
+                       get { return (DeployTarget) List [n]; }
+               }
+               
+               protected override void OnInsert (int index, object value)
+               {
+                       ((DeployTarget)value).CombineEntry = owner;
+               }
+
+               protected override void OnSet (int index, object oldValue, 
object newValue)
+               {
+                       ((DeployTarget)newValue).CombineEntry = owner;
+               }
        }
 }

Deleted: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs
   2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs
   2007-03-29 17:04:05 UTC (rev 75156)
@@ -1,81 +0,0 @@
-//
-// DirectoryDeployHandler.cs
-//
-// Author:
-//   Lluis Sanchez Gual
-//
-// Copyright (C) 2006 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.Collections.Generic;
-using System.IO;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Deployment.Extensions;
-
-namespace MonoDevelop.Projects.Deployment
-{
-       public class DirectoryDeployHandler: IDeployHandler
-       {
-               public string Id {
-                       get { return "MonoDevelop.DirectoryDeploy"; } 
-               }
-               
-               public string Description {
-                       get { return GettextCatalog.GetString ("Directory"); } 
-               }
-               
-               public string Icon {
-                       get { return "md-closed-folder"; }
-               }
-               
-               public bool CanDeploy (CombineEntry entry) 
-               {
-                       return entry is Project || entry is Combine;
-               }
-               
-               public DeployTarget CreateTarget (CombineEntry entry)
-               {
-                       return new DirectoryDeployTarget ();
-               }
-               
-               public void Deploy (IProgressMonitor monitor, DeployTarget 
target)
-               {
-                       if (target.CombineEntry is Project)
-                               DeployProject (monitor, target, (Project) 
target.CombineEntry);
-                       else {
-                               Combine c = (Combine) target.CombineEntry;
-                               foreach (Project p in c.GetAllProjects ())
-                                       DeployProject (monitor, target, p);
-                       }
-               }
-               
-               void DeployProject (IProgressMonitor monitor, DeployTarget 
target, Project p)
-               {
-                       DirectoryDeployTarget dt = (DirectoryDeployTarget) 
target;
-                       DeployFileCollection deployFiles = p.GetDeployFiles ();
-                       
-                       dt.CopierConfiguration.CopyFiles (monitor, new 
SimpleFileReplacePolicy (FileReplaceMode.Replace), deployFiles);
-               }
-       }
-}

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs
    2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs
    2007-03-29 17:04:05 UTC (rev 75156)
@@ -28,6 +28,7 @@
 
 using System;
 using MonoDevelop.Projects.Serialization;
+using MonoDevelop.Core;
 
 namespace MonoDevelop.Projects.Deployment
 {
@@ -36,6 +37,14 @@
                [ItemProperty ("Copier")]
                FileCopyConfiguration copierConfiguration;
                
+               public override string Description {
+                       get { return GettextCatalog.GetString ("Directory"); } 
+               }
+               
+               public override string Icon {
+                       get { return "md-closed-folder"; }
+               }
+               
                public override void CopyFrom (DeployTarget other)
                {
                        base.CopyFrom (other);
@@ -51,5 +60,16 @@
                        get { return copierConfiguration; }
                        set { copierConfiguration = value; }
                }
+               
+               public override bool CanDeploy (CombineEntry entry) 
+               {
+                       return entry is Project || entry is Combine;
+               }
+               
+               protected override void OnDeployProject (IProgressMonitor 
monitor, Project project)
+               {
+                       DeployFileCollection deployFiles = 
project.GetDeployFiles ();
+                       CopierConfiguration.CopyFiles (monitor, new 
SimpleFileReplacePolicy (FileReplaceMode.Replace), deployFiles);
+               }
        }
 }

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/FileCopyHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/FileCopyHandler.cs
  2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/FileCopyHandler.cs
  2007-03-29 17:04:05 UTC (rev 75156)
@@ -31,7 +31,6 @@
 using System.IO;
 
 using MonoDevelop.Core;
-using MonoDevelop.Projects.Deployment.Extensions;
 
 namespace MonoDevelop.Projects.Deployment
 {

Copied: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/IFileCopyHandler.cs
 (from rev 74974, 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs)
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs
      2007-03-26 12:04:03 UTC (rev 74974)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/IFileCopyHandler.cs
 2007-03-29 17:04:05 UTC (rev 75156)
@@ -0,0 +1,44 @@
+//
+// IFileCopyHandler.cs
+//
+// Author:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//   Lluis Sanchez Gual
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+// 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.IO;
+
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Projects.Deployment
+{
+       public interface IFileCopyHandler
+       {
+               string Id { get; }
+               string Name { get; }
+               FileCopyConfiguration CreateConfiguration ();
+               void CopyFiles (IProgressMonitor monitor, IFileReplacePolicy 
replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection files);
+       }
+}

Deleted: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployHandler.cs
     2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployHandler.cs
     2007-03-29 17:04:05 UTC (rev 75156)
@@ -1,116 +0,0 @@
-//
-// InstallDeployHandler.cs
-//
-// Author:
-//   Lluis Sanchez Gual
-//
-// 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.IO;
-using System.Collections.Specialized;
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Deployment.Extensions;
-
-namespace MonoDevelop.Projects.Deployment
-{
-       
-       public class InstallDeployHandler: IDeployHandler
-       {
-               public string Id {
-                       get { return "MonoDevelop.InstallDeploy"; } 
-               }
-               
-               public string Description {
-                       get { return GettextCatalog.GetString ("Install"); } 
-               }
-               
-               public string Icon {
-                       get { return "md-closed-folder"; }
-               }
-               
-               public DeployTarget CreateTarget (CombineEntry entry)
-               {
-                       return new InstallDeployTarget ();
-               }
-               
-               public bool CanDeploy (CombineEntry entry) 
-               {
-                       return entry is Project || entry is Combine;
-               }
-               
-               public void Deploy (IProgressMonitor monitor, DeployTarget 
target)
-               {
-                       if (target.CombineEntry is Project)
-                               DeployProject (monitor, target, (Project) 
target.CombineEntry);
-                       else {
-                               Combine c = (Combine) target.CombineEntry;
-                               foreach (Project p in c.GetAllProjects ())
-                                       DeployProject (monitor, target, p);
-                       }
-               }
-               
-               void DeployProject (IProgressMonitor monitor, DeployTarget 
target, Project p)
-               {
-                       InstallDeployTarget dt = (InstallDeployTarget) target;
-                       DeployFileCollection deployFiles = p.GetDeployFiles ();
-                       StringDictionary dirs = GetDeployDirectories 
(dt.InstallPrefix, dt.ApplicationName);
-                       
-                       foreach (DeployFile df in deployFiles) {
-                               string targetPath = dirs [df.TargetDirectoryID];
-                               if (targetPath == null) {
-                                       monitor.ReportWarning ("Could not copy 
file '" + df.RelativeTargetPath + "': Unknown target directory.");
-                                       continue;
-                               }
-                               CopyFile (monitor, df.SourcePath, Path.Combine 
(targetPath, df.RelativeTargetPath));
-                       }
-               }
-               
-               void CopyFile (IProgressMonitor monitor, string src, string 
dest)
-               {
-                       dest = Runtime.FileService.GetFullPath (dest);
-                       monitor.Log.WriteLine (GettextCatalog.GetString 
("Deploying file {0}.", dest));
-                       
-                       string targetDir = Path.GetDirectoryName (dest);
-                       if (!Directory.Exists (targetDir))
-                               Directory.CreateDirectory (targetDir);
-                       Runtime.FileService.CopyFile (src, dest);
-               }
-               
-               StringDictionary GetDeployDirectories (string prefix, string 
appName)
-               {
-                       if (appName == null) appName = "";
-                       StringDictionary directories = new StringDictionary ();
-                       directories [TargetDirectory.ProgramFiles] = 
Path.Combine (Path.Combine (prefix, "lib"), appName);
-                       directories [TargetDirectory.Binaries] =  Path.Combine 
(prefix, "bin");
-                       directories [TargetDirectory.Personal] =  Path.Combine 
(Environment.GetFolderPath (Environment.SpecialFolder.Personal), appName);
-                       directories [TargetDirectory.CommonApplicationData] =  
Path.Combine (Environment.GetFolderPath 
(Environment.SpecialFolder.CommonApplicationData), appName);
-                       directories [TargetDirectory.ApplicationData] =  
Path.Combine (Environment.GetFolderPath 
(Environment.SpecialFolder.ApplicationData), appName);
-                       return directories;
-               }
-       }
-       
-}

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployTarget.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployTarget.cs
      2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/InstallDeployTarget.cs
      2007-03-29 17:04:05 UTC (rev 75156)
@@ -28,7 +28,10 @@
 
 
 using System;
+using System.IO;
 using MonoDevelop.Projects.Serialization;
+using MonoDevelop.Core;
+using System.Collections.Specialized;
 
 namespace MonoDevelop.Projects.Deployment
 {
@@ -37,6 +40,14 @@
                string prefix = "";
                string appName = "";
                
+               public override string Description {
+                       get { return GettextCatalog.GetString ("Install"); } 
+               }
+               
+               public override string Icon {
+                       get { return "md-closed-folder"; }
+               }
+               
                [ItemProperty]
                public string InstallPrefix {
                        get { return prefix; }
@@ -58,5 +69,54 @@
                                appName = t.appName;
                        }
                }
+               
+               public override bool CanDeploy (CombineEntry entry) 
+               {
+                       return entry is Project || entry is Combine;
+               }
+               
+               protected override void OnInitialize (CombineEntry entry)
+               {
+                       if (string.IsNullOrEmpty (appName))
+                               appName = entry.Name;
+               }
+               
+               protected override void OnDeployProject (IProgressMonitor 
monitor, Project project)
+               {
+                       DeployFileCollection deployFiles = 
project.GetDeployFiles ();
+                       StringDictionary dirs = GetDeployDirectories 
(InstallPrefix, ApplicationName);
+                       
+                       foreach (DeployFile df in deployFiles) {
+                               string targetPath = dirs [df.TargetDirectoryID];
+                               if (targetPath == null) {
+                                       monitor.ReportWarning ("Could not copy 
file '" + df.RelativeTargetPath + "': Unknown target directory.");
+                                       continue;
+                               }
+                               CopyFile (monitor, df.SourcePath, Path.Combine 
(targetPath, df.RelativeTargetPath));
+                       }
+               }
+               
+               void CopyFile (IProgressMonitor monitor, string src, string 
dest)
+               {
+                       dest = Runtime.FileService.GetFullPath (dest);
+                       monitor.Log.WriteLine (GettextCatalog.GetString 
("Deploying file {0}.", dest));
+                       
+                       string targetDir = Path.GetDirectoryName (dest);
+                       if (!Directory.Exists (targetDir))
+                               Directory.CreateDirectory (targetDir);
+                       Runtime.FileService.CopyFile (src, dest);
+               }
+               
+               StringDictionary GetDeployDirectories (string prefix, string 
appName)
+               {
+                       if (appName == null) appName = "";
+                       StringDictionary directories = new StringDictionary ();
+                       directories [TargetDirectory.ProgramFiles] = 
Path.Combine (Path.Combine (prefix, "lib"), appName);
+                       directories [TargetDirectory.Binaries] =  Path.Combine 
(prefix, "bin");
+                       directories [TargetDirectory.Personal] =  Path.Combine 
(Environment.GetFolderPath (Environment.SpecialFolder.Personal), appName);
+                       directories [TargetDirectory.CommonApplicationData] =  
Path.Combine (Environment.GetFolderPath 
(Environment.SpecialFolder.CommonApplicationData), appName);
+                       directories [TargetDirectory.ApplicationData] =  
Path.Combine (Environment.GetFolderPath 
(Environment.SpecialFolder.ApplicationData), appName);
+                       return directories;
+               }
        }
 }

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs
     2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs
     2007-03-29 17:04:05 UTC (rev 75156)
@@ -31,7 +31,6 @@
 using System.IO;
 
 using MonoDevelop.Core;
-using MonoDevelop.Projects.Deployment.Extensions;
 
 namespace MonoDevelop.Projects.Deployment
 {

Deleted: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs
        2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs
        2007-03-29 17:04:05 UTC (rev 75156)
@@ -1,44 +0,0 @@
-//
-// IDeployHandler.cs
-//
-// Author:
-//   Lluis Sanchez Gual
-//
-// Copyright (C) 2006 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 MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Deployment.Extensions
-{
-       public interface IDeployHandler
-       {
-               string Id { get; }
-               string Description { get; }
-               string Icon { get; }
-               bool CanDeploy (CombineEntry entry);
-               DeployTarget CreateTarget (CombineEntry entry);
-               void Deploy (IProgressMonitor monitor, DeployTarget target);
-       }
-}

Deleted: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs
      2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs
      2007-03-29 17:04:05 UTC (rev 75156)
@@ -1,44 +0,0 @@
-//
-// IFileCopyHandler.cs
-//
-// Author:
-//   Michael Hutchinson <[EMAIL PROTECTED]>
-//   Lluis Sanchez Gual
-//
-// Copyright (C) 2006 Michael Hutchinson
-//
-// 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.IO;
-
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Deployment.Extensions
-{
-       public interface IFileCopyHandler
-       {
-               string Id { get; }
-               string Name { get; }
-               FileCopyConfiguration CreateConfiguration ();
-               void CopyFiles (IProgressMonitor monitor, IFileReplacePolicy 
replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection files);
-       }
-}

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml  
    2007-03-29 17:01:33 UTC (rev 75155)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml  
    2007-03-29 17:04:05 UTC (rev 75156)
@@ -77,10 +77,10 @@
        </Extension>
 
        <Extension path = "/SharpDevelop/Workbench/DeployHandlers" 
extension-nodes="Class" description="Deployment handlers. Specified classes 
must implement IDeployHandler.">
-               <Class class = 
"MonoDevelop.Projects.Deployment.DirectoryDeployHandler" />
-               <Class class = 
"MonoDevelop.Projects.Deployment.InstallDeployHandler" />
-               <Class class = 
"MonoDevelop.Projects.Deployment.CommandDeployHandler" />
-               <Class class = 
"MonoDevelop.Projects.Deployment.CombinedDeployHandler" />
+               <Class class = 
"MonoDevelop.Projects.Deployment.DirectoryDeployTarget" />
+               <Class class = 
"MonoDevelop.Projects.Deployment.InstallDeployTarget" />
+               <Class class = 
"MonoDevelop.Projects.Deployment.CommandDeployTarget" />
+               <Class class = 
"MonoDevelop.Projects.Deployment.CombinedDeployTarget" />
        </Extension>
 
        <Extension path = "/SharpDevelop/Workbench/DeployFileCopiers" 
extension-nodes="Class" description="File copiers for deployment handlers. 
Specified classes must implement IDeployFileCopier.">

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.mdp
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.mdp    
2007-03-29 17:01:33 UTC (rev 75155)
+++ trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.mdp    
2007-03-29 17:04:05 UTC (rev 75156)
@@ -210,7 +210,6 @@
     <File name="./MonoDevelop.Projects.Extensions/DataTypeCodon.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/DeployService.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/DeployTarget.cs" 
subtype="Code" buildaction="Compile" />
-    <File name="./MonoDevelop.Projects.Deployment/DeployHandler.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects/UnknownCombineEntry.cs" subtype="Code" 
buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/UnknownDeployTarget.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/DirectoryDeployTarget.cs" 
subtype="Code" buildaction="Compile" />
@@ -218,7 +217,6 @@
     <File name="./MonoDevelop.Projects.Text/TextEncoding.cs" subtype="Code" 
buildaction="Compile" />
     <File name="./ChangeLog" subtype="Code" buildaction="Nothing" />
     <File name="./Makefile.am" subtype="Code" buildaction="Nothing" />
-    <File name="./MonoDevelop.Projects.Deployment/DirectoryDeployHandler.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.addin.xml" subtype="Code" 
buildaction="FileCopy" />
     <File name="./MonoDevelop.Projects.Ambience/Ambience.cs" subtype="Code" 
buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Documentation/IDocumentationService.cs" 
subtype="Code" buildaction="Compile" />
@@ -228,19 +226,14 @@
     <File name="./MonoDevelop.Projects/ProjectServiceExtension.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/DeployFile.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/FileCopyHandler.cs" 
subtype="Code" buildaction="Compile" />
-    <File name="./MonoDevelop.Projects.Deployment/InstallDeployHandler.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/IFileReplacePolicy.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/FileCopyConfiguration.cs" 
subtype="Code" buildaction="Compile" />
     <File 
name="./MonoDevelop.Projects.Deployment/UnknownFileCopyConfiguration.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/InstallDeployTarget.cs" 
subtype="Code" buildaction="Compile" />
-    <File 
name="./MonoDevelop.Projects.Deployment.Extensions/IDeployHandler.cs" 
subtype="Code" buildaction="Compile" />
-    <File 
name="./MonoDevelop.Projects.Deployment.Extensions/IFileCopyHandler.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/LocalFileCopyHandler.cs" 
subtype="Code" buildaction="Compile" />
     <File 
name="./MonoDevelop.Projects.Deployment/LocalFileCopyConfiguration.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/CommandDeployTarget.cs" 
subtype="Code" buildaction="Compile" />
-    <File name="./MonoDevelop.Projects.Deployment/CommandDeployHandler.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Deployment/CombinedDeployTarget.cs" 
subtype="Code" buildaction="Compile" />
-    <File name="./MonoDevelop.Projects.Deployment/CombinedDeployHandler.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Parser/MemberCollectionBase.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Text/TextFileReader.cs" subtype="Code" 
buildaction="Compile" />
     <File name="./MonoDevelop.Projects.Parser/ClassWrapper.cs" subtype="Code" 
buildaction="Compile" />
@@ -253,6 +246,7 @@
     <File name="./MonoDevelop.Projects.dll.config" subtype="Code" 
buildaction="FileCopy" />
     <File name="./MonoDevelop.Projects/CustomCommandExtension.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.Projects/ProjectConvertTool.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="./MonoDevelop.Projects.Deployment/IFileCopyHandler.cs" 
subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="False" refto="monodoc, 
Version=1.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />

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

Reply via email to