mirror of https://gitlab.com/basile.b/dexed.git
moved runProject to TCEProject
This commit is contained in:
parent
49b693f6b0
commit
47bfe2fccc
|
@ -1531,7 +1531,8 @@ end;
|
||||||
procedure TCEMainForm.actProjCompileAndRunExecute(Sender: TObject);
|
procedure TCEMainForm.actProjCompileAndRunExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
compileProject(fProject);
|
compileProject(fProject);
|
||||||
runProject(fProject);
|
//runProject(fProject);
|
||||||
|
fProject.runProject;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.actProjCompAndRunWithArgsExecute(Sender: TObject);
|
procedure TCEMainForm.actProjCompAndRunWithArgsExecute(Sender: TObject);
|
||||||
|
@ -1542,7 +1543,8 @@ begin
|
||||||
//
|
//
|
||||||
runargs := '';
|
runargs := '';
|
||||||
if InputQuery('Execution arguments', '', runargs) then
|
if InputQuery('Execution arguments', '', runargs) then
|
||||||
runProject(fProject, runargs);
|
//runProject(fProject, runargs);
|
||||||
|
fProject.runProject(runargs);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.actProjRunExecute(Sender: TObject);
|
procedure TCEMainForm.actProjRunExecute(Sender: TObject);
|
||||||
|
@ -1580,7 +1582,8 @@ begin
|
||||||
compileProject(fProject);
|
compileProject(fProject);
|
||||||
_run:
|
_run:
|
||||||
if fileExists(fProject.outputFilename) then
|
if fileExists(fProject.outputFilename) then
|
||||||
runProject(fProject);
|
//runProject(fProject);
|
||||||
|
fProject.runProject;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.actProjRunWithArgsExecute(Sender: TObject);
|
procedure TCEMainForm.actProjRunWithArgsExecute(Sender: TObject);
|
||||||
|
|
|
@ -8,7 +8,7 @@ uses
|
||||||
{$IFDEF DEBUG}
|
{$IFDEF DEBUG}
|
||||||
LclProc,
|
LclProc,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, SysUtils, process, asyncprocess, ce_common, ce_writableComponent,
|
Classes, SysUtils, process, asyncprocess, strUtils, ce_common, ce_writableComponent,
|
||||||
ce_dmdwrap, ce_libman, ce_observer;
|
ce_dmdwrap, ce_libman, ce_observer;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -72,7 +72,7 @@ type
|
||||||
function addConfiguration: TCompilerConfiguration;
|
function addConfiguration: TCompilerConfiguration;
|
||||||
procedure getOpts(const aList: TStrings);
|
procedure getOpts(const aList: TStrings);
|
||||||
function outputFilename: string;
|
function outputFilename: string;
|
||||||
function runProject: Boolean;
|
function runProject(const runArgs: string = ''): Boolean;
|
||||||
function compileProject: Boolean;
|
function compileProject: Boolean;
|
||||||
//
|
//
|
||||||
property libraryManager: TLibraryManager read fLibMan write fLibMan;
|
property libraryManager: TLibraryManager read fLibMan write fLibMan;
|
||||||
|
@ -483,11 +483,39 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCEProject.runProject: Boolean;
|
function TCEProject.runProject(const runArgs: string = ''): Boolean;
|
||||||
|
var
|
||||||
|
prm: string;
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
result := false;
|
result := false;
|
||||||
killProcess(fRunner);
|
killProcess(fRunner);
|
||||||
fRunner := TAsyncProcess.Create(nil);
|
//
|
||||||
|
fRunner := TAsyncProcess.Create(nil); // fRunner can use the input process widget.
|
||||||
|
currentConfiguration.runOptions.setProcess(fRunner);
|
||||||
|
prm := '';
|
||||||
|
i := 1;
|
||||||
|
repeat
|
||||||
|
prm := ExtractDelimited(i, runArgs, [' ']);
|
||||||
|
prm := CEMainForm.expandSymbolicString(prm);
|
||||||
|
if prm <> '``' then
|
||||||
|
fRunner.Parameters.AddText(prm);
|
||||||
|
Inc(i);
|
||||||
|
until prm = '``';
|
||||||
|
//
|
||||||
|
if not fileExists(outputFilename) then
|
||||||
|
begin
|
||||||
|
subjLmStandard(TCELogMessageSubject(fLogMessager),
|
||||||
|
'output executable missing: ' + shortenPath(outputFilename,25), @Self, amcProj, amkErr);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
//
|
||||||
|
fRunner.Executable := outputFilename;
|
||||||
|
if fRunner.CurrentDirectory = '' then
|
||||||
|
fRunner.CurrentDirectory := extractFilePath(fRunner.Executable);
|
||||||
|
subjLmProcess(TCELogMessageSubject(fLogMessager), fRunner, @Self, amcProj, amkBub);
|
||||||
|
fRunner.Execute;
|
||||||
|
//
|
||||||
result := true;
|
result := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue