diff options
author | Alan McGovern <alan.mcgovern@gmail.com> | 2011-11-11 17:31:49 +0400 |
---|---|---|
committer | Alan McGovern <alan.mcgovern@gmail.com> | 2011-11-11 22:00:39 +0400 |
commit | 59392add73d2ba387312c73e3b9d1f8fabe8f756 (patch) | |
tree | 8d27522d20aef06acfcbc5dfa4ed60690e20be9e /main/src/addins/CSharpBinding | |
parent | 9432ef99744fe0e63b264c06e3c8df3c64e91801 (diff) |
[Core] Handle cleaning projects with readonly bin directories
Diffstat (limited to 'main/src/addins/CSharpBinding')
-rw-r--r-- | main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs index ac1068e118..564a8f2721 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs @@ -61,12 +61,12 @@ namespace MonoDevelop.CSharp FilePath outputName = configuration.CompiledOutputName; string responseFileName = Path.GetTempFileName(); - if (File.Exists (outputName)) {
- outputName.MakeWritable(); + if (File.Exists (outputName)) { bool isWriteable = false; int count = 0; do { try { + outputName.MakeWritable (); using (var stream = File.OpenWrite (outputName)) { isWriteable = true; } @@ -268,11 +268,11 @@ namespace MonoDevelop.CSharp sb.AppendLine (compilerParameters.AdditionalArguments); if (!string.IsNullOrEmpty (compilerParameters.NoWarnings)) - AppendQuoted (sb, "/nowarn:", compilerParameters.NoWarnings);
-
- if (runtime.RuntimeId == "MS.NET") {
- sb.AppendLine("/fullpaths");
- sb.AppendLine("/utf8output");
+ AppendQuoted (sb, "/nowarn:", compilerParameters.NoWarnings); + + if (runtime.RuntimeId == "MS.NET") { + sb.AppendLine("/fullpaths"); + sb.AppendLine("/utf8output"); } string output = ""; @@ -397,8 +397,8 @@ namespace MonoDevelop.CSharp StreamWriter outwr = new StreamWriter (output); StreamWriter errwr = new StreamWriter (error); - ProcessStartInfo pinfo = new ProcessStartInfo (compilerName, compilerArgs);
- pinfo.StandardErrorEncoding = Encoding.UTF8;
+ ProcessStartInfo pinfo = new ProcessStartInfo (compilerName, compilerArgs); + pinfo.StandardErrorEncoding = Encoding.UTF8; pinfo.StandardOutputEncoding = Encoding.UTF8; pinfo.WorkingDirectory = working_dir; @@ -426,7 +426,7 @@ namespace MonoDevelop.CSharp return exitCode; } - // Snatched from our codedom code, with some changes to make it compatible with csc
+ // Snatched from our codedom code, with some changes to make it compatible with csc // (the line+column group is optional is csc) static Regex regexError = new Regex (@"^(\s*(?<file>[^\(]+)(\((?<line>\d*)(,(?<column>\d*[\+]*))?\))?:\s+)*(?<level>\w+)\s+(?<number>..\d+):\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture); static BuildError CreateErrorFromString (string error_string) |