Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1161 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
12 changed files with 74 additions and 202 deletions
@ -1,17 +0,0 @@ |
|||||||
// <file>
|
|
||||||
// <copyright see="prj:///doc/copyright.txt"/>
|
|
||||||
// <license see="prj:///doc/license.txt"/>
|
|
||||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
|
||||||
// <version>$Revision$</version>
|
|
||||||
// </file>
|
|
||||||
|
|
||||||
using System; |
|
||||||
using System.CodeDom.Compiler; |
|
||||||
|
|
||||||
namespace ICSharpCode.Build.Tasks |
|
||||||
{ |
|
||||||
public interface ICompilerResultsParser |
|
||||||
{ |
|
||||||
CompilerResults Parse(TempFileCollection tempFiles, string outputFileName, string errorFileName); |
|
||||||
} |
|
||||||
} |
|
@ -1,53 +0,0 @@ |
|||||||
// <file>
|
|
||||||
// <copyright see="prj:///doc/copyright.txt"/>
|
|
||||||
// <license see="prj:///doc/license.txt"/>
|
|
||||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
|
||||||
// <version>$Revision$</version>
|
|
||||||
// </file>
|
|
||||||
|
|
||||||
using System; |
|
||||||
using System.CodeDom.Compiler; |
|
||||||
using System.IO; |
|
||||||
|
|
||||||
namespace ICSharpCode.Build.Tasks |
|
||||||
{ |
|
||||||
public class MonoCompiler |
|
||||||
{ |
|
||||||
CompilerResults results; |
|
||||||
|
|
||||||
public MonoCompiler() |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
public int Run(string compiler, string args, ICompilerResultsParser parser) |
|
||||||
{ |
|
||||||
string responseFileName = Path.GetTempFileName(); |
|
||||||
|
|
||||||
using (StreamWriter writer = new StreamWriter(responseFileName)) { |
|
||||||
writer.Write(args); |
|
||||||
} |
|
||||||
|
|
||||||
//string outstr = String.Concat(compilerFileName, compilerparameters.NoConfig ? " /noconfig" : String.Empty, " \"@", responseFileName, "\"");
|
|
||||||
string outputFileName = String.Empty; |
|
||||||
string errorFileName = String.Empty; |
|
||||||
TempFileCollection tempFiles = new TempFileCollection(); |
|
||||||
string command = String.Concat(compiler, " \"@", responseFileName, "\""); |
|
||||||
|
|
||||||
int returnValue = Executor.ExecWaitWithCapture(command, tempFiles, ref outputFileName, ref errorFileName); |
|
||||||
|
|
||||||
results = parser.Parse(tempFiles, outputFileName, errorFileName); |
|
||||||
|
|
||||||
File.Delete(responseFileName); |
|
||||||
File.Delete(outputFileName); |
|
||||||
File.Delete(errorFileName); |
|
||||||
|
|
||||||
return returnValue; |
|
||||||
} |
|
||||||
|
|
||||||
public CompilerResults Results { |
|
||||||
get { |
|
||||||
return results; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue