mirror of https://gitlab.com/basile.b/dexed.git
projects, CE & DUB, async compilation
This commit is contained in:
parent
ccc3f7c956
commit
a533057ff5
|
@ -42,6 +42,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
procedure docNew(aDoc: TCESynMemo);
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
procedure docFocused(aDoc: TCESynMemo);
|
procedure docFocused(aDoc: TCESynMemo);
|
||||||
|
@ -175,6 +176,10 @@ end;
|
||||||
procedure TCEDcdWrapper.projCompiling(aProject: ICECommonProject);
|
procedure TCEDcdWrapper.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEDcdWrapper.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
||||||
|
|
|
@ -5,13 +5,15 @@ unit ce_dubproject;
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, fpjson, jsonparser, jsonscanner, process, strutils,
|
Classes, SysUtils, fpjson, jsonparser, jsonscanner, process, strutils, LazFileUtils,
|
||||||
ce_common, ce_interfaces, ce_observer, ce_dialogs;
|
ce_common, ce_interfaces, ce_observer, ce_dialogs, ce_processes;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
TCEDubProject = class(TComponent, ICECommonProject)
|
TCEDubProject = class(TComponent, ICECommonProject)
|
||||||
private
|
private
|
||||||
|
fDubProc: TCEProcess;
|
||||||
|
fPreCompilePath: string;
|
||||||
fPackageName: string;
|
fPackageName: string;
|
||||||
fFilename: string;
|
fFilename: string;
|
||||||
fModified: boolean;
|
fModified: boolean;
|
||||||
|
@ -29,6 +31,7 @@ type
|
||||||
fModificationCount: integer;
|
fModificationCount: integer;
|
||||||
fOutputFileName: string;
|
fOutputFileName: string;
|
||||||
fSaveAsUtf8: boolean;
|
fSaveAsUtf8: boolean;
|
||||||
|
fCompiled: boolean;
|
||||||
//
|
//
|
||||||
procedure doModified;
|
procedure doModified;
|
||||||
procedure updateFields;
|
procedure updateFields;
|
||||||
|
@ -39,7 +42,8 @@ type
|
||||||
procedure updateImportPathsFromJson;
|
procedure updateImportPathsFromJson;
|
||||||
procedure updateOutputNameFromJson;
|
procedure updateOutputNameFromJson;
|
||||||
function findTargetKindInd(value: TJSONObject): boolean;
|
function findTargetKindInd(value: TJSONObject): boolean;
|
||||||
procedure dubProcOutput(proc: TProcess);
|
procedure dubProcOutput(proc: TObject);
|
||||||
|
procedure dubProcTerminated(proc: TObject);
|
||||||
function getCurrentCustomConfig: TJSONObject;
|
function getCurrentCustomConfig: TJSONObject;
|
||||||
function compileOrRun(run: boolean; const runArgs: string = ''): boolean;
|
function compileOrRun(run: boolean; const runArgs: string = ''): boolean;
|
||||||
public
|
public
|
||||||
|
@ -73,7 +77,8 @@ type
|
||||||
procedure setActiveConfigurationIndex(index: integer);
|
procedure setActiveConfigurationIndex(index: integer);
|
||||||
function configurationName(index: integer): string;
|
function configurationName(index: integer): string;
|
||||||
//
|
//
|
||||||
function compile: boolean;
|
procedure compile;
|
||||||
|
function compiled: boolean;
|
||||||
function run(const runArgs: string = ''): boolean;
|
function run(const runArgs: string = ''): boolean;
|
||||||
function targetUpToDate: boolean;
|
function targetUpToDate: boolean;
|
||||||
//
|
//
|
||||||
|
@ -348,7 +353,7 @@ end;
|
||||||
{$ENDREGION --------------------------------------------------------------------}
|
{$ENDREGION --------------------------------------------------------------------}
|
||||||
|
|
||||||
{$REGION ICECommonProject: actions ---------------------------------------------}
|
{$REGION ICECommonProject: actions ---------------------------------------------}
|
||||||
procedure TCEDubProject.dubProcOutput(proc: TProcess);
|
procedure TCEDubProject.dubProcOutput(proc: TObject);
|
||||||
var
|
var
|
||||||
lst: TStringList;
|
lst: TStringList;
|
||||||
str: string;
|
str: string;
|
||||||
|
@ -357,7 +362,7 @@ begin
|
||||||
lst := TStringList.Create;
|
lst := TStringList.Create;
|
||||||
msgs := getMessageDisplay;
|
msgs := getMessageDisplay;
|
||||||
try
|
try
|
||||||
processOutputToStrings(proc, lst);
|
fDubProc.getFullLines(lst);
|
||||||
for str in lst do
|
for str in lst do
|
||||||
msgs.message(str, self as ICECommonProject, amcProj, amkAuto);
|
msgs.message(str, self as ICECommonProject, amcProj, amkAuto);
|
||||||
finally
|
finally
|
||||||
|
@ -365,65 +370,93 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEDubProject.dubProcTerminated(proc: TObject);
|
||||||
|
var
|
||||||
|
msgs: ICEMessagesDisplay;
|
||||||
|
prjname: string;
|
||||||
|
begin
|
||||||
|
dubProcOutput(proc);
|
||||||
|
msgs := getMessageDisplay;
|
||||||
|
prjname := shortenPath(filename);
|
||||||
|
fCompiled := fDubProc.ExitStatus = 0;
|
||||||
|
if fCompiled then
|
||||||
|
msgs.message(prjname + ' has been successfully compiled',
|
||||||
|
self as ICECommonProject, amcProj, amkInf)
|
||||||
|
else
|
||||||
|
msgs.message(prjname + ' has not been compiled',
|
||||||
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
subjProjCompiled(fProjectSubject, self as ICECommonProject, fCompiled);
|
||||||
|
SetCurrentDirUTF8(fPreCompilePath);
|
||||||
|
end;
|
||||||
|
|
||||||
function TCEDubProject.compileOrRun(run: boolean; const runArgs: string = ''): boolean;
|
function TCEDubProject.compileOrRun(run: boolean; const runArgs: string = ''): boolean;
|
||||||
var
|
var
|
||||||
dubproc: TProcess;
|
|
||||||
olddir: string;
|
olddir: string;
|
||||||
prjname: string;
|
prjname: string;
|
||||||
msgs: ICEMessagesDisplay;
|
msgs: ICEMessagesDisplay;
|
||||||
begin
|
begin
|
||||||
result := false;
|
msgs := getMessageDisplay;
|
||||||
|
if fDubProc.isNotNil and fDubProc.Active then
|
||||||
|
begin
|
||||||
|
msgs.message('the project is already being compiled',
|
||||||
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
killProcess(fDubProc);
|
||||||
|
fCompiled := false;
|
||||||
if not fFilename.fileExists then
|
if not fFilename.fileExists then
|
||||||
begin
|
begin
|
||||||
dlgOkInfo('The DUB project must be saved before being compiled or run !');
|
dlgOkInfo('The DUB project must be saved before being compiled or run !');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
msgs := getMessageDisplay;
|
|
||||||
msgs.clearByData(Self as ICECommonProject);
|
msgs.clearByData(Self as ICECommonProject);
|
||||||
prjname := shortenPath(fFilename);
|
prjname := shortenPath(fFilename);
|
||||||
dubproc := TProcess.Create(nil);
|
fDubProc:= TCEProcess.Create(nil);
|
||||||
olddir := GetCurrentDir;
|
olddir := GetCurrentDir;
|
||||||
try
|
try
|
||||||
if not run then
|
if not run then
|
||||||
begin
|
begin
|
||||||
|
subjProjCompiling(fProjectSubject, self as ICECommonProject);
|
||||||
msgs.message('compiling ' + prjname, self as ICECommonProject, amcProj, amkInf);
|
msgs.message('compiling ' + prjname, self as ICECommonProject, amcProj, amkInf);
|
||||||
if modified then saveToFile(fFilename);
|
if modified then saveToFile(fFilename);
|
||||||
end;
|
end;
|
||||||
chDir(fFilename.extractFilePath);
|
chDir(fFilename.extractFilePath);
|
||||||
dubproc.Executable := 'dub' + exeExt;
|
fDubProc.Executable := 'dub' + exeExt;
|
||||||
dubproc.Options := dubproc.Options + [poStderrToOutPut, poUsePipes];
|
fDubProc.Options := fDubProc.Options + [poStderrToOutPut, poUsePipes];
|
||||||
dubproc.CurrentDirectory := fFilename.extractFilePath;
|
fDubProc.CurrentDirectory := fFilename.extractFilePath;
|
||||||
dubproc.ShowWindow := swoHIDE;
|
fDubProc.ShowWindow := swoHIDE;
|
||||||
if not run then
|
fDubProc.OnReadData:= @dubProcOutput;
|
||||||
dubproc.Parameters.Add('build')
|
|
||||||
else
|
|
||||||
dubproc.Parameters.Add('run');
|
|
||||||
dubproc.Parameters.Add('--build=' + fBuildTypes.Strings[fBuiltTypeIx]);
|
|
||||||
if (fConfigs.Count <> 1) and (fConfigs.Strings[0] <> DubDefaultConfigName) then
|
|
||||||
dubproc.Parameters.Add('--config=' + fConfigs.Strings[fConfigIx]);
|
|
||||||
dubProc.Parameters.Add('--compiler=' + DubCompilerFilename);
|
|
||||||
if run and runArgs.isNotEmpty then
|
|
||||||
dubproc.Parameters.Add('--' + runArgs);
|
|
||||||
dubproc.Execute;
|
|
||||||
while dubproc.Running do
|
|
||||||
dubProcOutput(dubproc);
|
|
||||||
if not run then
|
if not run then
|
||||||
begin
|
begin
|
||||||
if dubproc.ExitStatus = 0 then begin
|
fDubProc.Parameters.Add('build');
|
||||||
msgs.message(prjname + ' has been successfully compiled', self as ICECommonProject, amcProj, amkInf);
|
fDubProc.OnTerminate:= @dubProcTerminated;
|
||||||
result := true;
|
end
|
||||||
end else
|
else
|
||||||
msgs.message(prjname + ' has not been compiled', self as ICECommonProject, amcProj, amkWarn);
|
begin
|
||||||
|
fDubProc.Parameters.Add('run');
|
||||||
|
fDubProc.OnTerminate:= @dubProcOutput;
|
||||||
end;
|
end;
|
||||||
|
fDubProc.Parameters.Add('--build=' + fBuildTypes.Strings[fBuiltTypeIx]);
|
||||||
|
if (fConfigs.Count <> 1) and (fConfigs.Strings[0] <> DubDefaultConfigName) then
|
||||||
|
fDubProc.Parameters.Add('--config=' + fConfigs.Strings[fConfigIx]);
|
||||||
|
fDubProc.Parameters.Add('--compiler=' + DubCompilerFilename);
|
||||||
|
if run and runArgs.isNotEmpty then
|
||||||
|
fDubProc.Parameters.Add('--' + runArgs);
|
||||||
|
fDubProc.Execute;
|
||||||
finally
|
finally
|
||||||
chDir(olddir);
|
SetCurrentDirUTF8(olddir);
|
||||||
dubproc.Free;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCEDubProject.compile: boolean;
|
procedure TCEDubProject.compile;
|
||||||
begin
|
begin
|
||||||
result := compileOrRun(false);
|
fPreCompilePath := GetCurrentDirUTF8;
|
||||||
|
compileOrRun(false);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEDubProject.compiled: boolean;
|
||||||
|
begin
|
||||||
|
exit(fCompiled);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCEDubProject.run(const runArgs: string = ''): boolean;
|
function TCEDubProject.run(const runArgs: string = ''): boolean;
|
||||||
|
|
|
@ -62,6 +62,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
protected
|
protected
|
||||||
procedure SetVisible(Value: boolean); override;
|
procedure SetVisible(Value: boolean); override;
|
||||||
|
@ -211,6 +212,10 @@ end;
|
||||||
procedure TCEDubProjectEditorWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEDubProjectEditorWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEDubProjectEditorWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION Editor ----------------------------------------------------------------}
|
{$REGION Editor ----------------------------------------------------------------}
|
||||||
|
|
|
@ -75,6 +75,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
function SingleServiceName: string;
|
function SingleServiceName: string;
|
||||||
function documentCount: Integer;
|
function documentCount: Integer;
|
||||||
|
@ -226,6 +227,10 @@ end;
|
||||||
procedure TCEEditorWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEEditorWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEMultiDocHandler ----------------------------------------------------}
|
{$REGION ICEMultiDocHandler ----------------------------------------------------}
|
||||||
|
|
|
@ -108,13 +108,13 @@ type
|
||||||
procedure gdbCommand(aCommand: string; outputCatcher: TNotifyEvent = nil);
|
procedure gdbCommand(aCommand: string; outputCatcher: TNotifyEvent = nil);
|
||||||
procedure infoRegs;
|
procedure infoRegs;
|
||||||
procedure infoStack;
|
procedure infoStack;
|
||||||
|
|
||||||
//
|
//
|
||||||
procedure projNew(aProject: ICECommonProject);
|
procedure projNew(aProject: ICECommonProject);
|
||||||
procedure projChanged(aProject: ICECommonProject);
|
procedure projChanged(aProject: ICECommonProject);
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
procedure docNew(aDoc: TCESynMemo);
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
procedure docFocused(aDoc: TCESynMemo);
|
procedure docFocused(aDoc: TCESynMemo);
|
||||||
|
@ -179,6 +179,10 @@ end;
|
||||||
procedure TCEGdbWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEGdbWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEGdbWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
||||||
|
|
|
@ -76,8 +76,10 @@ type
|
||||||
|
|
||||||
// sub routines for the actions --------------------------------------------
|
// sub routines for the actions --------------------------------------------
|
||||||
|
|
||||||
// tries to compile and returns true if it does
|
// tries to compile.
|
||||||
function compile: boolean;
|
procedure compile;
|
||||||
|
// indicates wether last complation was successful.
|
||||||
|
function compiled: boolean;
|
||||||
// tries to un the project output and returns true if it did
|
// tries to un the project output and returns true if it did
|
||||||
function run(const runArgs: string = ''): boolean;
|
function run(const runArgs: string = ''): boolean;
|
||||||
// returns true if the target has not to be recompiled
|
// returns true if the target has not to be recompiled
|
||||||
|
@ -138,6 +140,8 @@ type
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
// aProject is about to be compiled
|
// aProject is about to be compiled
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
// aProject compilation is finsihed
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
end;
|
end;
|
||||||
(**
|
(**
|
||||||
* An implementer informs some ICEProjectObserver about the current project(s)
|
* An implementer informs some ICEProjectObserver about the current project(s)
|
||||||
|
@ -289,30 +293,6 @@ type
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(**
|
|
||||||
* Single service provided by the library manager
|
|
||||||
* In both cases, if someAliases is empty then all the available entries are passed.
|
|
||||||
*)
|
|
||||||
ICELibraryInformer = interface(ICESingleService)
|
|
||||||
// fills aList with the filenames of the static libraries matching to someAliases content.
|
|
||||||
procedure getLibsFiles(someAliases: TStrings; aList: TStrings);
|
|
||||||
// fills aList with the path to static libraries sources matching to someAliases content.
|
|
||||||
procedure getLibsPaths(someAliases: TStrings; aList: TStrings);
|
|
||||||
// fills aList with all the available libraries aliases.
|
|
||||||
procedure getLibsAliases(aList: TStrings);
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(**
|
|
||||||
* Single service that allows objects with a short life-time
|
|
||||||
* to get the project information.
|
|
||||||
*)
|
|
||||||
//ICEProjectInfos = interface(ICESingleService)
|
|
||||||
// function getCurrentProjectInterface: ICECommonProject;
|
|
||||||
//end;
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
subject primitives:
|
subject primitives:
|
||||||
|
|
||||||
|
@ -336,28 +316,17 @@ type
|
||||||
procedure subjProjFocused(aSubject: TCEProjectSubject; aProj: ICECommonProject); {$IFDEF RELEASE}inline;{$ENDIF}
|
procedure subjProjFocused(aSubject: TCEProjectSubject; aProj: ICECommonProject); {$IFDEF RELEASE}inline;{$ENDIF}
|
||||||
procedure subjProjChanged(aSubject: TCEProjectSubject; aProj: ICECommonProject); {$IFDEF RELEASE}inline;{$ENDIF}
|
procedure subjProjChanged(aSubject: TCEProjectSubject; aProj: ICECommonProject); {$IFDEF RELEASE}inline;{$ENDIF}
|
||||||
procedure subjProjCompiling(aSubject: TCEProjectSubject; aProj: ICECommonProject);{$IFDEF RELEASE}inline;{$ENDIF}
|
procedure subjProjCompiling(aSubject: TCEProjectSubject; aProj: ICECommonProject);{$IFDEF RELEASE}inline;{$ENDIF}
|
||||||
|
procedure subjProjCompiled(aSubject: TCEProjectSubject; aProj: ICECommonProject; success: boolean);{$IFDEF RELEASE}inline;{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Service getters:
|
Service getters:
|
||||||
|
|
||||||
The first overload assign the variable only when not yet set, the second is
|
|
||||||
designed for a punctual usage, for example if a widget needs the service in
|
|
||||||
a single and rarely called method.
|
|
||||||
}
|
}
|
||||||
|
function getMessageDisplay(var obj: ICEMessagesDisplay): ICEMessagesDisplay;
|
||||||
function getMessageDisplay(var obj: ICEMessagesDisplay): ICEMessagesDisplay; overload;
|
|
||||||
function getMessageDisplay: ICEMessagesDisplay; overload;
|
function getMessageDisplay: ICEMessagesDisplay; overload;
|
||||||
|
|
||||||
function getprocInputHandler(var obj: ICEProcInputHandler): ICEProcInputHandler; overload;
|
|
||||||
function getprocInputHandler: ICEProcInputHandler; overload;
|
function getprocInputHandler: ICEProcInputHandler; overload;
|
||||||
|
|
||||||
function getMultiDocHandler(var obj: ICEMultiDocHandler): ICEMultiDocHandler; overload;
|
|
||||||
function getMultiDocHandler: ICEMultiDocHandler; overload;
|
function getMultiDocHandler: ICEMultiDocHandler; overload;
|
||||||
|
|
||||||
function getLibraryInformer(var obj: ICELibraryInformer): ICELibraryInformer; overload;
|
|
||||||
function getLibraryInformer: ICELibraryInformer; overload;
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$REGION TCEMultiDocSubject ----------------------------------------------------}
|
{$REGION TCEMultiDocSubject ----------------------------------------------------}
|
||||||
|
@ -434,6 +403,15 @@ begin
|
||||||
with aSubject do for i:= 0 to fObservers.Count-1 do
|
with aSubject do for i:= 0 to fObservers.Count-1 do
|
||||||
(fObservers.Items[i] as ICEProjectObserver).projCompiling(aProj);
|
(fObservers.Items[i] as ICEProjectObserver).projCompiling(aProj);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure subjProjCompiled(aSubject: TCEProjectSubject; aProj: ICECommonProject; success: boolean);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
with aSubject do for i:= 0 to fObservers.Count-1 do
|
||||||
|
(fObservers.Items[i] as ICEProjectObserver).projCompiled(aProj, success);
|
||||||
|
end;
|
||||||
|
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICESingleService getters ----------------------------------------------}
|
{$REGION ICESingleService getters ----------------------------------------------}
|
||||||
|
@ -472,18 +450,6 @@ function getMultiDocHandler: ICEMultiDocHandler;
|
||||||
begin
|
begin
|
||||||
exit(EntitiesConnector.getSingleService('ICEMultiDocHandler') as ICEMultiDocHandler);
|
exit(EntitiesConnector.getSingleService('ICEMultiDocHandler') as ICEMultiDocHandler);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function getLibraryInformer(var obj: ICELibraryInformer): ICELibraryInformer;
|
|
||||||
begin
|
|
||||||
if obj = nil then
|
|
||||||
obj := EntitiesConnector.getSingleService('ICELibraryInformer') as ICELibraryInformer;
|
|
||||||
exit(obj);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function getLibraryInformer: ICELibraryInformer;
|
|
||||||
begin
|
|
||||||
exit(EntitiesConnector.getSingleService('ICELibraryInformer') as ICELibraryInformer);
|
|
||||||
end;
|
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -19,6 +19,8 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
//
|
||||||
function getFilename(src: TObject): string;
|
function getFilename(src: TObject): string;
|
||||||
public
|
public
|
||||||
constructor create;
|
constructor create;
|
||||||
|
@ -71,6 +73,10 @@ procedure TDDHandler.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDDHandler.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
function TDDHandler.getFilename(src: TObject): string;
|
function TDDHandler.getFilename(src: TObject): string;
|
||||||
var
|
var
|
||||||
lst: TListView;
|
lst: TListView;
|
||||||
|
|
|
@ -52,6 +52,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
procedure dataToGrid;
|
procedure dataToGrid;
|
||||||
procedure gridToData;
|
procedure gridToData;
|
||||||
|
@ -128,6 +129,10 @@ procedure TCELibManEditorWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCELibManEditorWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCELibManEditorWidget.ListEdited(Sender: TObject; Item: TListItem; var AValue: string);
|
procedure TCELibManEditorWidget.ListEdited(Sender: TObject; Item: TListItem; var AValue: string);
|
||||||
begin
|
begin
|
||||||
gridToData;
|
gridToData;
|
||||||
|
|
|
@ -225,9 +225,11 @@ type
|
||||||
fSymlWidg: TCESymbolListWidget;
|
fSymlWidg: TCESymbolListWidget;
|
||||||
fInfoWidg: TCEInfoWidget;
|
fInfoWidg: TCEInfoWidget;
|
||||||
fDubProjWidg: TCEDubProjectEditorWidget;
|
fDubProjWidg: TCEDubProjectEditorWidget;
|
||||||
fGdbWidg: TCEGdbWidget;
|
//fGdbWidg: TCEGdbWidget;
|
||||||
fDfmtWidg: TCEDfmtWidget;
|
fDfmtWidg: TCEDfmtWidget;
|
||||||
|
|
||||||
|
fRunProjAfterCompArg: boolean;
|
||||||
|
fRunProjAfterCompile: boolean;
|
||||||
fFirstShown: boolean;
|
fFirstShown: boolean;
|
||||||
fProjFromCommandLine: boolean;
|
fProjFromCommandLine: boolean;
|
||||||
fInitialized: boolean;
|
fInitialized: boolean;
|
||||||
|
@ -255,6 +257,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
|
||||||
// ICEEditableShortcut
|
// ICEEditableShortcut
|
||||||
function scedWantFirst: boolean;
|
function scedWantFirst: boolean;
|
||||||
|
@ -830,7 +833,7 @@ begin
|
||||||
fSymlWidg := TCESymbolListWidget.create(self);
|
fSymlWidg := TCESymbolListWidget.create(self);
|
||||||
fInfoWidg := TCEInfoWidget.create(self);
|
fInfoWidg := TCEInfoWidget.create(self);
|
||||||
fDubProjWidg:= TCEDubProjectEditorWidget.create(self);
|
fDubProjWidg:= TCEDubProjectEditorWidget.create(self);
|
||||||
fGdbWidg := TCEGdbWidget.create(self);
|
//fGdbWidg := TCEGdbWidget.create(self);
|
||||||
fDfmtWidg := TCEDfmtWidget.create(self);
|
fDfmtWidg := TCEDfmtWidget.create(self);
|
||||||
|
|
||||||
getMessageDisplay(fMsgs);
|
getMessageDisplay(fMsgs);
|
||||||
|
@ -849,7 +852,7 @@ begin
|
||||||
fWidgList.addWidget(@fSymlWidg);
|
fWidgList.addWidget(@fSymlWidg);
|
||||||
fWidgList.addWidget(@fInfoWidg);
|
fWidgList.addWidget(@fInfoWidg);
|
||||||
fWidgList.addWidget(@fDubProjWidg);
|
fWidgList.addWidget(@fDubProjWidg);
|
||||||
fWidgList.addWidget(@fGdbWidg);
|
//fWidgList.addWidget(@fGdbWidg);
|
||||||
fWidgList.addWidget(@fDfmtWidg);
|
fWidgList.addWidget(@fDfmtWidg);
|
||||||
fWidgList.sort(@CompareWidgCaption);
|
fWidgList.sort(@CompareWidgCaption);
|
||||||
|
|
||||||
|
@ -1384,6 +1387,20 @@ end;
|
||||||
procedure TCEMainForm.projCompiling(aProject: ICECommonProject);
|
procedure TCEMainForm.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEMainForm.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
var
|
||||||
|
runArgs: string = '';
|
||||||
|
begin
|
||||||
|
if fRunProjAfterCompile and assigned(fProjectInterface) then
|
||||||
|
begin
|
||||||
|
if fRunProjAfterCompArg and not InputQuery('Execution arguments', '', runargs) then
|
||||||
|
runargs := '';
|
||||||
|
fProjectInterface.run(runargs);
|
||||||
|
end;
|
||||||
|
fRunProjAfterCompile := false;
|
||||||
|
fRunProjAfterCompArg := false;
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEEditableShortCut ---------------------------------------------------}
|
{$REGION ICEEditableShortCut ---------------------------------------------------}
|
||||||
|
@ -1991,18 +2008,13 @@ end;
|
||||||
|
|
||||||
procedure TCEMainForm.actProjCompileAndRunExecute(Sender: TObject);
|
procedure TCEMainForm.actProjCompileAndRunExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if fProjectInterface.compile then
|
fRunProjAfterCompile := true;
|
||||||
fProjectInterface.run;
|
fProjectInterface.compile;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.actProjCompAndRunWithArgsExecute(Sender: TObject);
|
procedure TCEMainForm.actProjCompAndRunWithArgsExecute(Sender: TObject);
|
||||||
var
|
|
||||||
runargs: string = '';
|
|
||||||
begin
|
begin
|
||||||
if not fProjectInterface.compile then
|
fRunProjAfterCompArg := true;
|
||||||
exit;
|
|
||||||
if InputQuery('Execution arguments', '', runargs) then
|
|
||||||
fProjectInterface.run(runargs);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.actProjRunExecute(Sender: TObject);
|
procedure TCEMainForm.actProjRunExecute(Sender: TObject);
|
||||||
|
|
|
@ -133,6 +133,7 @@ type
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projChanged(aProject: ICECommonProject);
|
procedure projChanged(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
procedure docNew(aDoc: TCESynMemo);
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
procedure docClosing(aDoc: TCESynMemo);
|
procedure docClosing(aDoc: TCESynMemo);
|
||||||
|
@ -655,6 +656,10 @@ end;
|
||||||
procedure TCEMessagesWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEMessagesWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEMessagesWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
||||||
|
|
|
@ -113,6 +113,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
procedure docNew(aDoc: TCESynMemo);
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
procedure docFocused(aDoc: TCESynMemo);
|
procedure docFocused(aDoc: TCESynMemo);
|
||||||
|
@ -328,6 +329,10 @@ end;
|
||||||
procedure TCEMiniExplorerWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEMiniExplorerWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEMiniExplorerWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEMultidocObserver ---------------------------------------------------}
|
{$REGION ICEMultidocObserver ---------------------------------------------------}
|
||||||
|
|
|
@ -68,6 +68,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
public
|
public
|
||||||
constructor create; override;
|
constructor create; override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
@ -208,6 +209,10 @@ procedure TCEMRUProjectList.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUProjectList.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCEMRUProjectList.projClosing(aProject: ICECommonProject);
|
procedure TCEMRUProjectList.projClosing(aProject: ICECommonProject);
|
||||||
var
|
var
|
||||||
fname: string;
|
fname: string;
|
||||||
|
|
|
@ -26,8 +26,10 @@ type
|
||||||
*)
|
*)
|
||||||
TCENativeProject = class(TWritableLfmTextComponent, ICECommonProject)
|
TCENativeProject = class(TWritableLfmTextComponent, ICECommonProject)
|
||||||
private
|
private
|
||||||
|
fCompilProc: TCEProcess;
|
||||||
fOnChange: TNotifyEvent;
|
fOnChange: TNotifyEvent;
|
||||||
fModified: boolean;
|
fModified: boolean;
|
||||||
|
fPreCompilePath: string;
|
||||||
fRootFolder: string;
|
fRootFolder: string;
|
||||||
fBasePath: string;
|
fBasePath: string;
|
||||||
fRunnerOldCwd: string;
|
fRunnerOldCwd: string;
|
||||||
|
@ -41,6 +43,7 @@ type
|
||||||
fOutputFilename: string;
|
fOutputFilename: string;
|
||||||
fCanBeRun: boolean;
|
fCanBeRun: boolean;
|
||||||
fBaseConfig: TCompilerConfiguration;
|
fBaseConfig: TCompilerConfiguration;
|
||||||
|
fCompiled: boolean;
|
||||||
procedure updateOutFilename;
|
procedure updateOutFilename;
|
||||||
procedure doChanged;
|
procedure doChanged;
|
||||||
procedure getBaseConfig;
|
procedure getBaseConfig;
|
||||||
|
@ -56,7 +59,8 @@ type
|
||||||
// passes pre/post/executed project/ outputs as bubles.
|
// passes pre/post/executed project/ outputs as bubles.
|
||||||
procedure runProcOutput(sender: TObject);
|
procedure runProcOutput(sender: TObject);
|
||||||
// passes compilation message as "to be guessed"
|
// passes compilation message as "to be guessed"
|
||||||
procedure compProcOutput(proc: TProcess);
|
procedure compProcOutput(proc: TObject);
|
||||||
|
procedure compProcTerminated(proc: TObject);
|
||||||
protected
|
protected
|
||||||
procedure beforeLoad; override;
|
procedure beforeLoad; override;
|
||||||
procedure afterSave; override;
|
procedure afterSave; override;
|
||||||
|
@ -103,7 +107,8 @@ type
|
||||||
function importPath(index: integer): string;
|
function importPath(index: integer): string;
|
||||||
//
|
//
|
||||||
function run(const runArgs: string = ''): Boolean;
|
function run(const runArgs: string = ''): Boolean;
|
||||||
function compile: Boolean;
|
function compiled: Boolean;
|
||||||
|
procedure compile;
|
||||||
function targetUpToDate: boolean;
|
function targetUpToDate: boolean;
|
||||||
//
|
//
|
||||||
property configuration[ix: integer]: TCompilerConfiguration read getConfig;
|
property configuration[ix: integer]: TCompilerConfiguration read getConfig;
|
||||||
|
@ -156,6 +161,7 @@ destructor TCENativeProject.destroy;
|
||||||
begin
|
begin
|
||||||
subjProjClosing(fProjectSubject, self);
|
subjProjClosing(fProjectSubject, self);
|
||||||
fProjectSubject.Free;
|
fProjectSubject.Free;
|
||||||
|
fCompilProc.Free;
|
||||||
//
|
//
|
||||||
fOnChange := nil;
|
fOnChange := nil;
|
||||||
fLibAliases.Free;
|
fLibAliases.Free;
|
||||||
|
@ -708,17 +714,28 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCENativeProject.compile: Boolean;
|
function TCENativeProject.compiled: boolean;
|
||||||
|
begin
|
||||||
|
exit(fCompiled);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCENativeProject.compile;
|
||||||
var
|
var
|
||||||
config: TCompilerConfiguration;
|
config: TCompilerConfiguration;
|
||||||
compilproc: TProcess;
|
prjpath: string;
|
||||||
prjpath, oldCwd, str: string;
|
|
||||||
prjname: string;
|
prjname: string;
|
||||||
msgs: ICEMessagesDisplay;
|
msgs: ICEMessagesDisplay;
|
||||||
begin
|
begin
|
||||||
result := false;
|
|
||||||
config := currentConfiguration;
|
|
||||||
msgs := getMessageDisplay;
|
msgs := getMessageDisplay;
|
||||||
|
if fCompilProc.isNotNil and fCompilProc.Active then
|
||||||
|
begin
|
||||||
|
msgs.message('the project is already being compiled',
|
||||||
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
killProcess(fCompilProc);
|
||||||
|
fCompiled := false;
|
||||||
|
config := currentConfiguration;
|
||||||
if config.isNil then
|
if config.isNil then
|
||||||
begin
|
begin
|
||||||
msgs.message('unexpected project error: no active configuration',
|
msgs.message('unexpected project error: no active configuration',
|
||||||
|
@ -730,55 +747,35 @@ begin
|
||||||
subjProjCompiling(fProjectSubject, Self);
|
subjProjCompiling(fProjectSubject, Self);
|
||||||
//
|
//
|
||||||
prjpath := fFileName.extractFilePath;
|
prjpath := fFileName.extractFilePath;
|
||||||
oldCwd := GetCurrentDirUTF8;
|
fPreCompilePath := GetCurrentDirUTF8;
|
||||||
SetCurrentDirUTF8(prjpath);
|
SetCurrentDirUTF8(prjpath);
|
||||||
//
|
//
|
||||||
if not runPrePostProcess(config.preBuildProcess) then
|
if not runPrePostProcess(config.preBuildProcess) then
|
||||||
msgs.message('warning: pre-compilation process or commands not properly executed',
|
msgs.message('warning: pre-compilation process or commands not properly executed',
|
||||||
self as ICECommonProject, amcProj, amkWarn);
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
//
|
||||||
SetCurrentDirUTF8(prjpath);
|
SetCurrentDirUTF8(prjpath);
|
||||||
//
|
//
|
||||||
if (Sources.Count = 0) and (config.pathsOptions.extraSources.Count = 0) then
|
if (Sources.Count = 0) and (config.pathsOptions.extraSources.Count = 0) then
|
||||||
begin
|
begin
|
||||||
SetCurrentDirUTF8(oldCwd);
|
SetCurrentDirUTF8(fPreCompilePath);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
//
|
//
|
||||||
prjname := shortenPath(filename, 25);
|
prjname := shortenPath(filename, 25);
|
||||||
compilproc := TProcess.Create(nil);
|
fCompilProc := TCEProcess.Create(nil);
|
||||||
try
|
subjProjCompiling(fProjectSubject, self as ICECommonProject);
|
||||||
msgs.message('compiling ' + prjname, self as ICECommonProject, amcProj, amkInf);
|
msgs.message('compiling ' + prjname, self as ICECommonProject, amcProj, amkInf);
|
||||||
// this doesn't work under linux, so the previous ChDir.
|
// this doesn't work under linux, so the previous ChDir.
|
||||||
if prjpath.dirExists then
|
if prjpath.dirExists then
|
||||||
compilproc.CurrentDirectory := prjpath;
|
fCompilProc.CurrentDirectory := prjpath;
|
||||||
compilproc.Executable := NativeProjectCompilerFilename;
|
fCompilProc.Executable := NativeProjectCompilerFilename;
|
||||||
compilproc.Options := compilproc.Options + [poStderrToOutPut, poUsePipes];
|
fCompilProc.Options := fCompilProc.Options + [poStderrToOutPut, poUsePipes];
|
||||||
compilproc.ShowWindow := swoHIDE;
|
fCompilProc.ShowWindow := swoHIDE;
|
||||||
getOpts(compilproc.Parameters);
|
fCompilProc.OnReadData:= @compProcOutput;
|
||||||
compilproc.Execute;
|
fCompilProc.OnTerminate:= @compProcTerminated;
|
||||||
if NativeProjectCompiler = gdc then
|
getOpts(fCompilProc.Parameters);
|
||||||
begin
|
fCompilProc.Execute;
|
||||||
str := 'gdc';
|
|
||||||
compilproc.Input.Write(str[1], 3);
|
|
||||||
compilproc.CloseInput;
|
|
||||||
end;
|
|
||||||
while compilProc.Running do
|
|
||||||
compProcOutput(compilproc);
|
|
||||||
if compilproc.ExitStatus = 0 then begin
|
|
||||||
msgs.message(prjname + ' has been successfully compiled', self as ICECommonProject, amcProj, amkInf);
|
|
||||||
result := true;
|
|
||||||
end else
|
|
||||||
msgs.message(prjname + ' has not been compiled', self as ICECommonProject, amcProj, amkWarn);
|
|
||||||
finally
|
|
||||||
updateOutFilename;
|
|
||||||
compilproc.Free;
|
|
||||||
end;
|
|
||||||
SetCurrentDirUTF8(prjpath);
|
|
||||||
//
|
|
||||||
if not runPrePostProcess(config.PostBuildProcess) then
|
|
||||||
msgs.message( 'warning: post-compilation process or commands not properly executed',
|
|
||||||
self as ICECommonProject, amcProj, amkWarn);
|
|
||||||
SetCurrentDirUTF8(oldCwd);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCENativeProject.run(const runArgs: string = ''): Boolean;
|
function TCENativeProject.run(const runArgs: string = ''): Boolean;
|
||||||
|
@ -792,7 +789,7 @@ begin
|
||||||
if fRunnerOldCwd.dirExists then
|
if fRunnerOldCwd.dirExists then
|
||||||
ChDir(fRunnerOldCwd);
|
ChDir(fRunnerOldCwd);
|
||||||
//
|
//
|
||||||
fRunner := TCEProcess.Create(nil); // fRunner can use the input process widget.
|
fRunner := TCEProcess.Create(nil);
|
||||||
currentConfiguration.runOptions.setProcess(fRunner);
|
currentConfiguration.runOptions.setProcess(fRunner);
|
||||||
if runArgs.isNotEmpty then
|
if runArgs.isNotEmpty then
|
||||||
begin
|
begin
|
||||||
|
@ -863,16 +860,16 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCENativeProject.compProcOutput(proc: TProcess);
|
procedure TCENativeProject.compProcOutput(proc: TObject);
|
||||||
var
|
var
|
||||||
lst: TStringList;
|
lst: TStringList;
|
||||||
str: string;
|
str: string;
|
||||||
msgs: ICEMessagesDisplay;
|
msgs: ICEMessagesDisplay;
|
||||||
begin
|
begin
|
||||||
lst := TStringList.Create;
|
lst := TStringList.Create;
|
||||||
msgs := getMessageDisplay;
|
|
||||||
try
|
try
|
||||||
processOutputToStrings(proc, lst);
|
msgs := getMessageDisplay;
|
||||||
|
fCompilProc.getFullLines(lst);
|
||||||
for str in lst do
|
for str in lst do
|
||||||
msgs.message(str, self as ICECommonProject, amcProj, amkAuto);
|
msgs.message(str, self as ICECommonProject, amcProj, amkAuto);
|
||||||
finally
|
finally
|
||||||
|
@ -880,6 +877,31 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCENativeProject.compProcTerminated(proc: TObject);
|
||||||
|
var
|
||||||
|
msgs: ICEMessagesDisplay;
|
||||||
|
prjname: string;
|
||||||
|
begin
|
||||||
|
compProcOutput(proc);
|
||||||
|
msgs := getMessageDisplay;
|
||||||
|
prjname := shortenPath(filename);
|
||||||
|
fCompiled := fCompilProc.ExitStatus = 0;
|
||||||
|
updateOutFilename;
|
||||||
|
if fCompiled then
|
||||||
|
msgs.message(prjname + ' has been successfully compiled',
|
||||||
|
self as ICECommonProject, amcProj, amkInf)
|
||||||
|
else
|
||||||
|
msgs.message(prjname + ' has not been compiled',
|
||||||
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
//
|
||||||
|
if not runPrePostProcess(getCurrConf.postBuildProcess) then
|
||||||
|
msgs.message( 'warning: post-compilation process or commands not properly executed',
|
||||||
|
self as ICECommonProject, amcProj, amkWarn);
|
||||||
|
subjProjCompiled(fProjectSubject, self as ICECommonProject, fCompiled);
|
||||||
|
//
|
||||||
|
SetCurrentDirUTF8(fPreCompilePath);
|
||||||
|
end;
|
||||||
|
|
||||||
function TCENativeProject.targetUpToDate: boolean;
|
function TCENativeProject.targetUpToDate: boolean;
|
||||||
var
|
var
|
||||||
dt: double;
|
dt: double;
|
||||||
|
|
|
@ -65,7 +65,6 @@ type
|
||||||
// anObserver must be removed.
|
// anObserver must be removed.
|
||||||
procedure removeObserver(anObserver: TObject);
|
procedure removeObserver(anObserver: TObject);
|
||||||
// optionally implemented to trigger all the methods of the observer interface.
|
// optionally implemented to trigger all the methods of the observer interface.
|
||||||
procedure updateObservers;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Base type for an interface that contains the methods of a subject.
|
// Base type for an interface that contains the methods of a subject.
|
||||||
|
@ -89,7 +88,6 @@ type
|
||||||
//
|
//
|
||||||
procedure addObserver(anObserver: TObject);
|
procedure addObserver(anObserver: TObject);
|
||||||
procedure removeObserver(anObserver: TObject);
|
procedure removeObserver(anObserver: TObject);
|
||||||
procedure updateObservers; virtual;
|
|
||||||
//
|
//
|
||||||
property observersCount: Integer read getObserversCount;
|
property observersCount: Integer read getObserversCount;
|
||||||
property observers[index: Integer]: TObject read getObserver; default;
|
property observers[index: Integer]: TObject read getObserver; default;
|
||||||
|
@ -227,7 +225,6 @@ begin
|
||||||
exit(fServices[i]);
|
exit(fServices[i]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION TCECustomSubject ------------------------------------------------------}
|
{$REGION TCECustomSubject ------------------------------------------------------}
|
||||||
|
@ -272,11 +269,6 @@ procedure TCECustomSubject.removeObserver(anObserver: TObject);
|
||||||
begin
|
begin
|
||||||
fObservers.Remove(anObserver);
|
fObservers.Remove(anObserver);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCECustomSubject.updateObservers;
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
|
@ -50,6 +50,7 @@ type
|
||||||
procedure projChanged(aProject: ICECommonProject);
|
procedure projChanged(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
protected
|
protected
|
||||||
procedure updateImperative; override;
|
procedure updateImperative; override;
|
||||||
procedure SetVisible(Value: boolean); override;
|
procedure SetVisible(Value: boolean); override;
|
||||||
|
@ -146,6 +147,10 @@ end;
|
||||||
procedure TCEProjectConfigurationWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEProjectConfigurationWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEProjectConfigurationWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION --------------------------------------------------------------------}
|
{$ENDREGION --------------------------------------------------------------------}
|
||||||
|
|
||||||
{$REGION config. things --------------------------------------------------------}
|
{$REGION config. things --------------------------------------------------------}
|
||||||
|
|
|
@ -50,6 +50,7 @@ type
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projChanged(aProject: ICECommonProject);
|
procedure projChanged(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
protected
|
protected
|
||||||
function contextName: string; override;
|
function contextName: string; override;
|
||||||
function contextActionCount: integer; override;
|
function contextActionCount: integer; override;
|
||||||
|
@ -183,6 +184,10 @@ end;
|
||||||
procedure TCEProjectInspectWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEProjectInspectWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEProjectInspectWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION Inspector things -------------------------------------------------------}
|
{$REGION Inspector things -------------------------------------------------------}
|
||||||
|
|
|
@ -90,6 +90,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
procedure docNew(aDoc: TCESynMemo);
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
procedure docClosing(aDoc: TCESynMemo);
|
procedure docClosing(aDoc: TCESynMemo);
|
||||||
|
@ -482,6 +483,10 @@ end;
|
||||||
procedure TCESearchWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCESearchWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCESearchWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
||||||
|
|
|
@ -32,6 +32,7 @@ type
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projChanged(aProject: ICECommonProject);
|
procedure projChanged(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
//
|
//
|
||||||
procedure docNew(aDoc: TCESynMemo);
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
procedure docClosing(aDoc: TCESynMemo);
|
procedure docClosing(aDoc: TCESynMemo);
|
||||||
|
@ -108,6 +109,10 @@ end;
|
||||||
procedure TCESymbolExpander.projCompiling(aProject: ICECommonProject);
|
procedure TCESymbolExpander.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCESymbolExpander.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
||||||
|
|
|
@ -104,6 +104,7 @@ type
|
||||||
procedure projClosing(aProject: ICECommonProject);
|
procedure projClosing(aProject: ICECommonProject);
|
||||||
procedure projFocused(aProject: ICECommonProject);
|
procedure projFocused(aProject: ICECommonProject);
|
||||||
procedure projCompiling(aProject: ICECommonProject);
|
procedure projCompiling(aProject: ICECommonProject);
|
||||||
|
procedure projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
// ICEEditableOptions
|
// ICEEditableOptions
|
||||||
function optionedWantCategory(): string;
|
function optionedWantCategory(): string;
|
||||||
function optionedWantEditorKind: TOptionEditorKind;
|
function optionedWantEditorKind: TOptionEditorKind;
|
||||||
|
@ -373,6 +374,10 @@ end;
|
||||||
procedure TCETodoListWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCETodoListWidget.projCompiling(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCETodoListWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION Todo list things ------------------------------------------------------}
|
{$REGION Todo list things ------------------------------------------------------}
|
||||||
|
|
Loading…
Reference in New Issue