* Project.cs (Load): Emit the .sln.proj file only if env var
authorAnkit Jain <radical@corewars.org>
Thu, 24 Sep 2009 19:04:11 +0000 (19:04 -0000)
committerAnkit Jain <radical@corewars.org>
Thu, 24 Sep 2009 19:04:11 +0000 (19:04 -0000)
XBUILD_EMIT_SOLUTION is set.

svn path=/trunk/mcs/; revision=142594

mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs

index 4c4e68cd32be974ccd27e7fec98847c29437ee9b..5e2c4847326b35c6b38ff257b6e741475b40e549 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-24  Ankit Jain  <jankit@novell.com>
+
+       * Project.cs (Load): Emit the .sln.proj file only if env var
+       XBUILD_EMIT_SOLUTION is set.
+
 2009-09-24  Ankit Jain  <jankit@novell.com>
 
        * Project.cs (GetKeyForTarget): Make target name, case insensitive.
index 0090a302c54cb0d295bb69b5060e63f15db80aef..225d3d764102a26d70e16d27fc64f7510fc932f5 100644 (file)
@@ -425,11 +425,17 @@ namespace Microsoft.Build.BuildEngine {
                                                LogWarning (filename, message);
                                        });
                                filename = fullFileName + ".proj";
-                               tmp_project.Save (filename);
-                               ParentEngine.RemoveLoadedProject (tmp_project);
+                               try {
+                                       tmp_project.Save (filename);
+                                       ParentEngine.RemoveLoadedProject (tmp_project);
+                                       DoLoad (new StreamReader (filename));
+                               } finally {
+                                       if (Environment.GetEnvironmentVariable ("XBUILD_EMIT_SOLUTION") == null)
+                                               File.Delete (filename);
+                               }
+                       } else {
+                               DoLoad (new StreamReader (filename));
                        }
-
-                       DoLoad (new StreamReader (filename));
                }
                
                [MonoTODO ("Not tested")]