Author: mkrueger
Date: 2007-05-15 09:19:44 -0400 (Tue, 15 May 2007)
New Revision: 77399

Modified:
   
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
   
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IProject.cs
   
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/MSBuildProject.cs
   
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectService.cs
Log:
Worked on projects.

Modified: 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
===================================================================
--- 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
  2007-05-15 12:09:04 UTC (rev 77398)
+++ 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
  2007-05-15 13:19:44 UTC (rev 77399)
@@ -66,8 +66,8 @@
                
                protected override void Run ()
                {
-                       
                        if (MonoDevelop.Ide.Projects.ProjectService.Solution != 
null) {
+                               Console.WriteLine ("a");
                                IAsyncOperation op = 
MonoDevelop.Ide.Projects.ProjectService.BuildSolution ();
                                op.Completed += new OperationHandler 
(ExecuteCombine);
                        } else {
@@ -81,8 +81,8 @@
                
                protected override void Update (CommandInfo info)
                {
-                       if (IdeApp.ProjectOperations.CurrentOpenCombine != 
null) {
-                               info.Enabled = 
IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted;
+                       if (MonoDevelop.Ide.Projects.ProjectService.Solution != 
null) {
+                               info.Enabled = 
MonoDevelop.Ide.Projects.ProjectService.CurrentRunOperation.IsCompleted;
                        } else {
                                info.Enabled = (IdeApp.Workbench.ActiveDocument 
!= null && IdeApp.Workbench.ActiveDocument.IsBuildTarget);
                        }
@@ -90,6 +90,7 @@
                
                void ExecuteCombine (IAsyncOperation op)
                {
+                       Console.WriteLine ("exec !!!");
                        if (op.Success)
                                // FIXME: check RunWithWarnings
                                
MonoDevelop.Ide.Projects.ProjectService.StartSolution ();
@@ -229,17 +230,17 @@
                
                protected override void Update (CommandInfo info)
                {
-                       if (IdeApp.ProjectOperations.CurrentOpenCombine != 
null) {
-                               CombineEntry entry = 
IdeApp.ProjectOperations.CurrentSelectedCombineEntry;
-                               if (entry != null) {
-                                       info.Enabled = 
IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted;
-                                       info.Text = GettextCatalog.GetString 
("Build {0}", entry.Name);
-                                       if (entry is Combine)
-                                               info.Description = 
GettextCatalog.GetString ("Build Solution {0}", entry.Name);
-                                       else if (entry is Project)
-                                               info.Description = 
GettextCatalog.GetString ("Build Project {0}", entry.Name);
-                                       else
-                                               info.Description = info.Text;
+                       if (MonoDevelop.Ide.Projects.ProjectService.Solution != 
null) {
+                               if 
(MonoDevelop.Ide.Projects.ProjectService.ActiveProject != null) {
+                                       info.Enabled = 
MonoDevelop.Ide.Projects.ProjectService.CurrentBuildOperation.IsCompleted;
+                                       string name = 
MonoDevelop.Ide.Projects.ProjectService.ActiveProject.Name; 
+                                       info.Text = GettextCatalog.GetString 
("Build {0}", name);
+/*                                     if (entry is Combine)
+                                               info.Description = 
GettextCatalog.GetString ("Build Solution {0}", name);
+                                       else if (entry is Project)*/
+                                               info.Description = 
GettextCatalog.GetString ("Build Project {0}", name);
+/*                                     else
+                                               info.Description = info.Text;*/
                                } else {
                                        info.Enabled = false;
                                }
@@ -272,11 +273,10 @@
                
                protected override void Update (CommandInfo info)
                {
-                       if (IdeApp.ProjectOperations.CurrentOpenCombine != 
null) {
-                               CombineEntry entry = 
IdeApp.ProjectOperations.CurrentSelectedCombineEntry;
-                               if (entry != null) {
-                                       info.Enabled = 
IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted;
-                                       info.Text = info.Description = 
GettextCatalog.GetString ("Rebuild {0}", entry.Name);
+                       if (MonoDevelop.Ide.Projects.ProjectService.Solution != 
null) {
+                               if 
(MonoDevelop.Ide.Projects.ProjectService.ActiveProject != null) {
+                                       info.Enabled = 
MonoDevelop.Ide.Projects.ProjectService.CurrentBuildOperation.IsCompleted;
+                                       info.Text = info.Description = 
GettextCatalog.GetString ("Rebuild {0}", 
MonoDevelop.Ide.Projects.ProjectService.ActiveProject.Name);
                                } else {
                                        info.Enabled = false;
                                }

Modified: 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IProject.cs
===================================================================
--- 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IProject.cs
 2007-05-15 12:09:04 UTC (rev 77398)
+++ 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IProject.cs
 2007-05-15 13:19:44 UTC (rev 77399)
@@ -41,6 +41,10 @@
                        set;
                }
                
+               string Name {
+                       get;
+               }
+               
                string BasePath {
                        get;
                }

Modified: 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/MSBuildProject.cs
===================================================================
--- 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/MSBuildProject.cs
   2007-05-15 12:09:04 UTC (rev 77398)
+++ 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/MSBuildProject.cs
   2007-05-15 13:19:44 UTC (rev 77399)
@@ -53,6 +53,13 @@
                        }
                }
                
+               public string Name {
+                       get {
+                               return Path.GetFileNameWithoutExtension 
(FileName);
+                       }
+               }
+               
+               
                public string BasePath {
                        get {
                                return Path.GetDirectoryName (FileName);
@@ -73,6 +80,7 @@
                
                public CompilerResult Build (IProgressMonitor monitor)
                {
+                       Console.WriteLine ("!!!!!!!!!!!");
                        string responseFileName = Path.GetTempFileName ();
                        Console.WriteLine ("response file:" + responseFileName);
                        using (StreamWriter writer = new StreamWriter 
(responseFileName)) {

Modified: 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectService.cs
===================================================================
--- 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectService.cs
   2007-05-15 12:09:04 UTC (rev 77398)
+++ 
branches/mkrueger/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectService.cs
   2007-05-15 13:19:44 UTC (rev 77399)
@@ -101,20 +101,19 @@
                        }
                        IProgressMonitor monitor = new 
MessageDialogProgressMonitor ();
                        ExecutionContext context = new ExecutionContext (new 
DefaultExecutionHandlerFactory (), IdeApp.Workbench.ProgressMonitors);
-
                        Services.DispatchService.ThreadDispatch (new 
StatefulMessageHandler (BuildSolutionAsync), new object[] {Solution, monitor, 
context});
-                       currentRunOperation = monitor.AsyncOperation;
+                       currentBuildOperation = monitor.AsyncOperation;
                        
                        return currentRunOperation;
                }
+               
                static void BuildSolutionAsync (object data)
                {
-                       Console.WriteLine ("1");
+
                        object[] array = (object[])data;
                        Solution solution = array[0] as Solution;
                        if (solution == null) 
                                return;
-                       Console.WriteLine ("2");
                        IProgressMonitor monitor = array[1] as IProgressMonitor;
                        ExecutionContext context = array[2] as ExecutionContext;
                        
@@ -122,8 +121,7 @@
                                SolutionProject project = item as 
SolutionProject;
                                if (project == null)
                                        continue;
-                               Console.WriteLine (" build:" + 
project.Location);
-                               BuildProject (project.Project);
+                               project.Project.Build (null);
                        }
                }
                
@@ -149,7 +147,7 @@
                        ExecutionContext context = new ExecutionContext (new 
DefaultExecutionHandlerFactory (), IdeApp.Workbench.ProgressMonitors);
 
                        Services.DispatchService.ThreadDispatch (new 
StatefulMessageHandler (BuildSolutionAsync), new object[] {project, monitor, 
context});
-                       currentRunOperation = monitor.AsyncOperation;
+                       currentBuildOperation = monitor.AsyncOperation;
                        return currentRunOperation;
                        
                        project.Build (null);

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

Reply via email to