public BuildResult CompileSource(SourceModule Module, DMDConfig dmd, bool DebugCompile, string objFile, string execDirectory) { var obj = Path.ChangeExtension(objFile, ".obj"); var br = new BuildResult() { SourceFile = Module.AbsoluteFileName, TargetFile = obj, Successful = true }; ErrorLogger.Log("Compile " + (Module.Project != null?Module.Project.ToRelativeFileName(Module.FileName):Module.FileName), ErrorType.Information, ErrorOrigin.Build); var dmd_exe = dmd.SoureCompiler; // Always enable it to use environment paths to find dmd.exe if (!Path.IsPathRooted(dmd_exe) && Directory.Exists(dmd.BaseDirectory)) { dmd_exe = Path.Combine(dmd.BaseDirectory, dmd.SoureCompiler); } TempPrc = FileExecution.ExecuteSilentlyAsync(dmd_exe, BuildDSourceCompileArgumentString(dmd.BuildArguments(DebugCompile).SoureCompiler, Module.AbsoluteFileName, obj, dmd.ImportDirectories), // Compile our program always in debug mode execDirectory, OnOutput, delegate(string s) { var err = ParseErrorMessage(s); if (Module.Project != null && Module.Project.ContainsFile(err.FileName)) { err.Project = Module.Project; } if (err.Type == GenericError.ErrorType.Error) { br.Successful = false; } br.BuildErrors.Add(err); }, OnExit); if (TempPrc != null && !TempPrc.HasExited) { TempPrc.WaitForExit(MaxCompilationTime); } br.Successful = br.Successful && TempPrc != null && TempPrc.ExitCode == 0 && File.Exists(obj); return(br); }
public void ShowBuildArgConfig(bool IsDebug) { var dlg = new BuildArgumentForm(Config.BuildArguments(IsDebug)); dlg.ShowDialog(); }
public BuildResult CompileSource(SourceModule Module,DMDConfig dmd,bool DebugCompile, string objFile, string execDirectory) { var obj = Path.ChangeExtension(objFile, ".obj"); var br = new BuildResult() { SourceFile = Module.AbsoluteFileName,TargetFile=obj,Successful=true }; ErrorLogger.Log("Compile " + (Module.Project!=null?Module.Project.ToRelativeFileName( Module.FileName):Module.FileName),ErrorType.Information,ErrorOrigin.Build); var dmd_exe = dmd.SoureCompiler; // Always enable it to use environment paths to find dmd.exe if (!Path.IsPathRooted(dmd_exe) && Directory.Exists(dmd.BaseDirectory)) dmd_exe = Path.Combine(dmd.BaseDirectory, dmd.SoureCompiler); TempPrc = FileExecution.ExecuteSilentlyAsync(dmd_exe, BuildDSourceCompileArgumentString(dmd.BuildArguments(DebugCompile).SoureCompiler, Module.AbsoluteFileName, obj,dmd.ImportDirectories), // Compile our program always in debug mode execDirectory, OnOutput, delegate(string s) { var err = ParseErrorMessage(s); if (Module.Project != null && Module.Project.ContainsFile(err.FileName)) err.Project = Module.Project; if (err.Type == GenericError.ErrorType.Error) br.Successful = false; br.BuildErrors.Add(err); }, OnExit); if (TempPrc != null && !TempPrc.HasExited) TempPrc.WaitForExit(MaxCompilationTime); br.Successful = br.Successful && TempPrc!=null && TempPrc.ExitCode==0 && File.Exists(obj); return br; }