IDE: run file: added RunFlag Messages to show output in Messages window

git-svn-id: trunk@50446 -
This commit is contained in:
mattias 2015-11-20 15:02:04 +00:00
parent be79f48411
commit e20508a446
3 changed files with 12 additions and 7 deletions

View File

@ -28,7 +28,7 @@ const
SubToolMake = 'make';
SubToolMakePriority = 1000; // higher than FPC
SubToolDefault = 'External Tool';
SubToolDefault = 'External Tool'; // this parser simply writes all output to Messages window
SubToolDefaultPriority = 0;
AbortedExitCode = 12321;

View File

@ -46,7 +46,8 @@ type
TIDEDirRunFlag = (
idedrfNone,
idedrfBuildBeforeRun // BUILD+ means on (default), BUILD- means off
idedrfBuildBeforeRun, // BUILD+ means on (default for non script), BUILD- means off
idedrfMessages // show output in Messages window
);
TIDEDirRunFlags = set of TIDEDirRunFlag;
const
@ -66,7 +67,8 @@ const
);
IDEDirRunFlagNames: array[TIDEDirRunFlag] of string = (
'',
'BUILD'
'BUILD',
'MESSAGES'
);
type

View File

@ -7419,13 +7419,14 @@ begin
FirstLine:='';
HasShebang:=copy(FirstLine,1,2)='#!';
DefRunFlags:=IDEDirRunFlagDefValues;
if HasShebang then Exclude(DefRunFlags,idedrfBuildBeforeRun);
if HasShebang then
Exclude(DefRunFlags,idedrfBuildBeforeRun);
RunFlags:=GetIDEDirRunFlagFromString(
GetIDEStringDirective(DirectiveList,IDEDirectiveNames[idedRunFlags],''),
DefRunFlags);
AlwaysBuildBeforeRun:=idedrfBuildBeforeRun in RunFlags;
if AlwaysBuildBeforeRun then begin
Result:=DoBuildFile(true);
Result:=DoBuildFile(true,Filename);
if Result<>mrOk then exit;
end;
RunWorkingDir:=GetIDEStringDirective(DirectiveList,
@ -7437,7 +7438,7 @@ begin
exit;
end;
if HasShebang then
DefRunCommand:='instantfpc'+ExeExt+' '+ActiveUnitInfo.Filename
DefRunCommand:='instantfpc'+ExeExt+' '+Filename
else
DefRunCommand:=IDEDirDefaultRunCommand;
RunCommand:=GetIDEStringDirective(DirectiveList,
@ -7454,10 +7455,12 @@ begin
ExtTool:=TIDEExternalToolOptions.Create;
try
ExtTool.Title:='Run File '+ActiveUnitInfo.Filename;
ExtTool.Title:='Run File '+Filename;
ExtTool.WorkingDirectory:=RunWorkingDir;
ExtTool.CmdLineParams:=Params;
ExtTool.Executable:=ProgramFilename;
if idedrfMessages in RunFlags then
ExtTool.Scanners.Add(SubToolDefault);
if RunExternalTool(ExtTool) then
Result:=mrOk
else