Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/addins/CBinding/Compiler/GNUCompiler.cs')
-rw-r--r--main/src/addins/CBinding/Compiler/GNUCompiler.cs47
1 files changed, 22 insertions, 25 deletions
diff --git a/main/src/addins/CBinding/Compiler/GNUCompiler.cs b/main/src/addins/CBinding/Compiler/GNUCompiler.cs
index b75471a9ff..be4a0bc5f8 100644
--- a/main/src/addins/CBinding/Compiler/GNUCompiler.cs
+++ b/main/src/addins/CBinding/Compiler/GNUCompiler.cs
@@ -56,7 +56,7 @@ namespace CBinding
ProjectFileCollection projectFiles,
ProjectPackageCollection packages,
CProjectConfiguration configuration,
- IProgressMonitor monitor)
+ ProgressMonitor monitor)
{
if (!appsChecked) {
appsChecked = true;
@@ -271,7 +271,7 @@ namespace CBinding
private bool PrecompileHeaders (ProjectFileCollection projectFiles,
CProjectConfiguration configuration,
string args,
- IProgressMonitor monitor,
+ ProgressMonitor monitor,
CompilerResults cr)
{
monitor.BeginTask (GettextCatalog.GetString ("Precompiling headers"), 1);
@@ -303,7 +303,7 @@ namespace CBinding
return success;
}
- private bool DoPrecompileHeader (ProjectFile file, string output, string args, IProgressMonitor monitor, CompilerResults cr)
+ private bool DoPrecompileHeader (ProjectFile file, string output, string args, ProgressMonitor monitor, CompilerResults cr)
{
string completeArgs = String.Format ("\"{0}\" {1} -o {2}", file.Name, args, output);
string errorOutput;
@@ -353,7 +353,7 @@ namespace CBinding
CProjectConfiguration configuration,
ProjectPackageCollection packages,
CompilerResults cr,
- IProgressMonitor monitor, string outputName)
+ ProgressMonitor monitor, string outputName)
{
if (!NeedsUpdate (projectFiles, configuration, outputName)) return;
@@ -406,7 +406,7 @@ namespace CBinding
CProjectConfiguration configuration,
ProjectPackageCollection packages,
CompilerResults cr,
- IProgressMonitor monitor, string outputName)
+ ProgressMonitor monitor, string outputName)
{
if (!NeedsUpdate (projectFiles, configuration, outputName)) return;
@@ -431,7 +431,7 @@ namespace CBinding
CProjectConfiguration configuration,
ProjectPackageCollection packages,
CompilerResults cr,
- IProgressMonitor monitor, string outputName)
+ ProgressMonitor monitor, string outputName)
{
if (!NeedsUpdate (projectFiles, configuration, outputName)) return;
@@ -479,7 +479,7 @@ namespace CBinding
CheckReturnCode (exitCode, cr);
}
- int ExecuteCommand (string command, string args, string baseDirectory, IProgressMonitor monitor, out string errorOutput)
+ int ExecuteCommand (string command, string args, string baseDirectory, ProgressMonitor monitor, out string errorOutput)
{
errorOutput = string.Empty;
int exitCode = -1;
@@ -491,23 +491,20 @@ namespace CBinding
monitor.Log.WriteLine ("{0} {1}", command, args);
- using (var operationMonitor = new AggregatedOperationMonitor (monitor)) {
- using (ProcessWrapper p = Runtime.ProcessService.StartProcess (command, args, baseDirectory, monitor.Log, chainedError, null)) {
- operationMonitor.AddOperation (p); //handles cancellation
-
- p.WaitForOutput ();
- chainedError.UnchainWriter (monitor.Log);
- chainedError.UnchainWriter (swError);
+ using (ProcessWrapper p = Runtime.ProcessService.StartProcess (command, args, baseDirectory, monitor.Log, chainedError, null))
+ using (monitor.CancellationToken.Register (p.Cancel)) {
+ p.WaitForOutput ();
+ chainedError.UnchainWriter (monitor.Log);
+ chainedError.UnchainWriter (swError);
- errorOutput = swError.ToString ();
- exitCode = p.ExitCode;
-
- if (monitor.IsCancelRequested) {
- monitor.Log.WriteLine (GettextCatalog.GetString ("Build cancelled"));
- monitor.ReportError (GettextCatalog.GetString ("Build cancelled"), null);
- if (exitCode == 0)
- exitCode = -1;
- }
+ errorOutput = swError.ToString ();
+ exitCode = p.ExitCode;
+
+ if (monitor.CancellationToken.IsCancellationRequested) {
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Build cancelled"));
+ monitor.ReportError (GettextCatalog.GetString ("Build cancelled"), null);
+ if (exitCode == 0)
+ exitCode = -1;
}
}
}
@@ -542,7 +539,7 @@ namespace CBinding
private bool DoCompilation (ProjectFile file,
CProjectConfiguration configuration,
string args,
- IProgressMonitor monitor,
+ ProgressMonitor monitor,
CompilerResults cr,
bool use_ccache)
{
@@ -605,7 +602,7 @@ namespace CBinding
return objectFiles.ToArray ();
}
- public override void Clean (ProjectFileCollection projectFiles, CProjectConfiguration configuration, IProgressMonitor monitor)
+ public override void Clean (ProjectFileCollection projectFiles, CProjectConfiguration configuration, ProgressMonitor monitor)
{
//clean up object files
foreach (string oFile in ObjectFiles(projectFiles, configuration, false)) {