[Monodevelop-patches-list] r1608 - in trunk/MonoDevelop/src/Main/Base: . Internal/Project/Combine

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue May 18 06:29:24 EDT 2004


Author: tberman
Date: 2004-05-18 06:29:23 -0400 (Tue, 18 May 2004)
New Revision: 1608

Modified:
   trunk/MonoDevelop/src/Main/Base/ChangeLog
   trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
Log:
adding a new file/property to solution serialization.

the use of this will become apparent soonish later.

time for a shower and the subway to work though.


Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-05-18 09:35:30 UTC (rev 1607)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-05-18 10:29:23 UTC (rev 1608)
@@ -1,3 +1,8 @@
+2004-05-18  Todd Berman  <tberman at sevenl.net>
+
+	* Internal/Project/Combine/Combine.cs: load/save a new property
+	'RelativeOutputPath' on the solution level. Much hilarity ensues.
+
 2004-05-17  Todd Berman  <tberman at sevenl.net>
 
 	* Commands/ProjectBrowserCommands/CombineNodeCommands.cs:

Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs	2004-05-18 09:35:30 UTC (rev 1607)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs	2004-05-18 10:29:23 UTC (rev 1608)
@@ -35,6 +35,7 @@
 		string startProject  = null;
 		bool   singleStartup = true;
 		string path          = null;
+		string outputdir     = null;
 		
 		ArrayList entries       = new ArrayList();
 		
@@ -97,6 +98,16 @@
 				OnStartupPropertyChanged(null);
 			}
 		}
+
+		public string OutputDirectory 
+		{
+			get {
+				return outputdir;
+			}
+			set {
+				outputdir = value;
+			}
+		}
 		
 		[LocalizedProperty("${res:MonoDevelop.Internal.Project.Combine.Name}",
 		                   Description ="${res:MonoDevelop.Internal.Project.Combine.Name.Description}")]
@@ -221,6 +232,19 @@
 					ActiveConfiguration = cconf;
 				}
 			}
+
+			string mdCombineAddition = Path.ChangeExtension (filename, "mdsx");
+			if (File.Exists (mdCombineAddition)) {
+				doc.Load (mdCombineAddition);
+				root = doc.DocumentElement;
+				if (root["RelativeOutputPath"] != null && root["RelativeOutputPath"].InnerText != null) {
+					outputdir = fileUtilityService.RelativeToAbsolutePath(path, root["RelativeOutputPath"].InnerText);
+				} else {
+					outputdir = Path.Combine (path, Path.Combine ("build", "bin"));
+				}
+			} else {
+				outputdir = Path.Combine (path, Path.Combine ("build", "bin"));
+			}
 		}
 		
 		public void SaveCombine(string filename)
@@ -300,7 +324,19 @@
 			fileUtilityService.ObservedSave(new NamedFileOperationDelegate(doc.Save),
 			                                filename,
 			                                GettextCatalog.GetString ("Can't save solution\nPlease check your file and directory permissions."),
-							FileErrorPolicy.ProvideAlternative);
+											FileErrorPolicy.ProvideAlternative);
+
+			doc = new XmlDocument ();
+			doc.LoadXml ("<MonoDevelopSolution fileversion=\"1.0\"/>");
+			XmlElement outputElement = doc.CreateElement ("RelativeOutputPath");
+			outputElement.InnerText = fileUtilityService.AbsoluteToRelativePath(path, outputdir);
+			
+			doc.DocumentElement.AppendChild (outputElement);
+			fileUtilityService.ObservedSave (new NamedFileOperationDelegate (doc.Save),
+											 Path.ChangeExtension (filename, "mdsx"),
+											 GettextCatalog.GetString ("Can't save solution\nPlease check your file and directory permissions."),
+											 FileErrorPolicy.ProvideAlternative);
+			
 		}
 		
 		public void SaveCombineAs()




More information about the Monodevelop-patches-list mailing list