~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
using MonoDevelop.Core.Execution;
37
37
using MonoDevelop.Core.Assemblies;
38
38
using MonoDevelop.CSharp.Project;
 
39
using System.Threading;
 
40
using MonoDevelop.Ide;
39
41
 
40
42
 
41
43
namespace MonoDevelop.CSharp
59
61
                        string outputName       = configuration.CompiledOutputName;
60
62
                        string responseFileName = Path.GetTempFileName();
61
63
                        
 
64
                        if (File.Exists (outputName)) {
 
65
                                bool isWriteable = false;
 
66
                                int count = 0;
 
67
                                do {
 
68
                                        try {
 
69
                                                using (var stream = File.OpenWrite (outputName)) {
 
70
                                                        isWriteable = true;
 
71
                                                }
 
72
                                        } catch (Exception) {
 
73
                                                Thread.Sleep (20);
 
74
                                        }
 
75
                                } while (count++ < 5 && !isWriteable);
 
76
                                if (!isWriteable) {
 
77
                                        MessageService.ShowError (string.Format (GettextCatalog.GetString ("Can't lock file: {0}."), outputName));
 
78
                                        return null;
 
79
                                }
 
80
                        }
 
81
                        
62
82
                        TargetRuntime runtime = MonoDevelop.Core.Runtime.SystemAssemblyService.DefaultRuntime;
63
83
                        DotNetProject project = configuration.ParentItem as DotNetProject;
64
84
                        if (project != null)
108
128
                                }
109
129
                        }
110
130
                        
 
131
                        string sysCore = project.AssemblyContext.GetAssemblyFullName ("System.Core", project.TargetFramework);
 
132
                        if (sysCore != null) {
 
133
                                sysCore = project.AssemblyContext.GetAssemblyLocation (sysCore, project.TargetFramework);
 
134
                                if (sysCore != null && !alreadyAddedReference.Contains (sysCore))
 
135
                                        AppendQuoted (sb, "/r:", sysCore);
 
136
                        }
 
137
                        
111
138
                        sb.AppendLine ("/nologo");
112
139
                        sb.Append ("/warn:");sb.Append (compilerParameters.WarningLevel.ToString ());
113
140
                        sb.AppendLine ();