Author: lluis
Date: 2005-10-11 11:15:27 -0400 (Tue, 11 Oct 2005)
New Revision: 51581

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml
   
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/BuildTool.cs
Log:
2005-10-11  Lluis Sanchez Gual  <[EMAIL PROTECTED]> 

        * MonoDevelop.Projects/BuildTool.cs: Basic implementation of build tool.
        * MonoDevelop.Projects.addin.xml: Fixed addin header information.
        Use "id" attribuet instead of "name" to identify addins.



Modified: trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog   2005-10-11 
15:15:00 UTC (rev 51580)
+++ trunk/monodevelop/Core/src/MonoDevelop.Projects/ChangeLog   2005-10-11 
15:15:27 UTC (rev 51581)
@@ -1,3 +1,9 @@
+2005-10-11  Lluis Sanchez Gual  <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.Projects/BuildTool.cs: Basic implementation of build tool.
+       * MonoDevelop.Projects.addin.xml: Fixed addin header information.
+       Use "id" attribuet instead of "name" to identify addins.
+
 2005-10-06  Lluis Sanchez Gual  <[EMAIL PROTECTED]> 
 
        * MonoDevelop.Projects/ProjectService.cs: Get serializable types from

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/BuildTool.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/BuildTool.cs
   2005-10-11 15:15:00 UTC (rev 51580)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects/BuildTool.cs
   2005-10-11 15:15:27 UTC (rev 51581)
@@ -28,18 +28,105 @@
 
 
 using System;
+using System.IO;
+using MonoDevelop.Projects;
 using MonoDevelop.Core.AddIns;
+using MonoDevelop.Core.ProgressMonitoring;
 
 namespace MonoDevelop.Projects
 {
        public class BuildTool : IApplication
        {
+               bool help;
+               string file;
+               string project;
+               
                public int Run (string[] arguments)
                {
                        Console.WriteLine ("MonoDevelop Build Tool");
                        foreach (string s in arguments)
-                               Console.WriteLine ("  " + s);
+                               ReadArgument (s);
+                       
+                       if (file == null) {
+                               string[] files = Directory.GetFiles (".", 
"*.mds");
+                               if (files.Length == 0)
+                                       files = Directory.GetFiles (".", 
"*.mdp");
+                               if (files.Length == 0) {
+                                       Console.WriteLine ("Project file not 
found.");
+                                       return 1;
+                               }
+                               file = files [0];
+                       }
+                       
+                       ConsoleProgressMonitor monitor = new 
ConsoleProgressMonitor ();
+                       
+                       CombineEntry centry = Services.ProjectService.ReadFile 
(file, monitor);
+                       
+                       if (project != null) {
+                               Combine combine = centry as Combine;
+                               centry = null;
+                               
+                               if (combine != null) {
+                                       centry = combine.FindProject (project);
+                               }
+                               if (centry == null) {
+                                       Console.WriteLine ("The project '" + 
project + "' could not be found in " + file);
+                                       return 1;
+                               }
+                       }
+                       
+                       ICompilerResult res = centry.Build (monitor);
+                       
                        return 0;
                }
+               
+               void ReadArgument (string argument)
+               {
+                       string optionValuePair;
+                       
+                       if (argument.StartsWith("--")) {
+                               optionValuePair = argument.Substring(2);
+                       }
+                       else if (argument.StartsWith("/") || 
argument.StartsWith("-")) {
+                               optionValuePair = argument.Substring(1);
+                       }
+                       else {
+                               return;
+                       }
+                       
+                       string option;
+                       string value;
+                       
+                       int indexOfEquals = optionValuePair.IndexOf(':');
+                       if (indexOfEquals > 0) {
+                               option = optionValuePair.Substring(0, 
indexOfEquals);
+                               value = optionValuePair.Substring(indexOfEquals 
+ 1);
+                       }
+                       else {
+                               option = optionValuePair;
+                               value = null;
+                       }
+                       
+                       switch (option)
+                       {
+                               case "f":
+                               case "buildfile":
+                                   file = value;
+                                   break;
+
+                               case "help":
+                               case "?":
+                                   help = true;
+                                   break;
+
+                               case "p":
+                               case "project":
+                                   project = value;
+                                   break;
+
+                               default:
+                                   throw new Exception("Unknown option '" + 
option + "'");
+                       }
+               }
        }
 }

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml  
    2005-10-11 15:15:00 UTC (rev 51580)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects/MonoDevelop.Projects.addin.xml  
    2005-10-11 15:15:27 UTC (rev 51581)
@@ -1,8 +1,9 @@
-<AddIn name        = "MonoDevelop.Projects"
-       author      = "Mike Krueger"
+<AddIn id          = "MonoDevelop.Projects"
+       name        = "MonoDevelop Project Services"
+       author      = "Todd Berman, John Luke, John Bou Antoun, Lluis Sanchez 
Gual, Christian Hergert, Mike Krueger"
        copyright   = "GPL"
-       url         = "http://www.icsharpcode.net";
-       description = "MonoDevelop.Projects module"
+       url         = "http://www.monodevelop.com";
+       description = "Provides support for loading and building MonoDevelop 
projects."
           category    = "MonoDevelop Core"
        version     = "0.9.0">
 
@@ -11,7 +12,7 @@
        </Runtime>
 
        <Dependencies>
-               <AddIn name="MonoDevelop.Core" version="0.9.0"/>
+               <AddIn id="MonoDevelop.Core" version="0.9.0"/>
        </Dependencies>
 
        <Extension path = "/Workspace/Services">

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

Reply via email to