mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-31 05:56:05 +02:00
project groups: compile project group
git-svn-id: trunk@50448 -
This commit is contained in:
parent
4769045cee
commit
e6e1297dc0
@ -1,8 +1,6 @@
|
||||
{
|
||||
ToDo:
|
||||
- save/restore Active target
|
||||
- Build file
|
||||
- build modes of project as nodes with checkboxes
|
||||
- run external tool
|
||||
- update files when project/package changes in IDE
|
||||
- update dependencies when changed in IDE
|
||||
@ -54,11 +52,11 @@ type
|
||||
function PerformNextTarget(AAction: TPGTargetAction): TPGActionResult;
|
||||
procedure ActiveChanged(Sender: TPGCompileTarget); override;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
procedure LoadTarget(Recursively: boolean); virtual;
|
||||
procedure LoadGroupSettings(XMLConfig: TXMLConfig; aPath: string);
|
||||
procedure SaveGroupSettings(XMLConfig: TXMLConfig; aPath: string);
|
||||
procedure UnLoadTarget; virtual;
|
||||
destructor Destroy; override;
|
||||
procedure Modified; override;
|
||||
end;
|
||||
|
||||
@ -754,7 +752,6 @@ begin
|
||||
Target:=TIDECompileTarget(AddTarget(TargetFileName));
|
||||
if pgloLoadRecursively in Options then
|
||||
Target.LoadTarget(true);
|
||||
// ToDo: load buildmode flags
|
||||
end
|
||||
else if (pgloRemoveInvalid in Options) then
|
||||
begin
|
||||
@ -1373,19 +1370,34 @@ end;
|
||||
|
||||
function TIDECompileTarget.ProjectGroupAction(AAction: TPGTargetAction
|
||||
): TPGActionResult;
|
||||
var
|
||||
i: Integer;
|
||||
aTarget: TIDECompileTarget;
|
||||
begin
|
||||
Result:=arFailed;
|
||||
|
||||
case AAction of
|
||||
taOpen: ProjectGroupManager.LoadProjectGroup(FileName,[]);
|
||||
taOpen:
|
||||
ProjectGroupManager.LoadProjectGroup(FileName,[]);
|
||||
taSettings: ;
|
||||
taCompile,
|
||||
taCompileClean,
|
||||
taCompileClean:
|
||||
begin
|
||||
for i:=0 to ProjectGroup.TargetCount-1 do begin
|
||||
aTarget:=TIDECompileTarget(ProjectGroup.Targets[i]);
|
||||
if AAction in aTarget.AllowedActions then
|
||||
if aTarget.PerformAction(AAction)<>arOk then
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
taCompileFromHere:
|
||||
begin
|
||||
// todo: compile all targets
|
||||
if AAction=taCompileFromHere then
|
||||
Result:=PerformNextTarget(taCompileFromHere);
|
||||
if ProjectGroupAction(taCompile)<>arOK then
|
||||
exit;
|
||||
Result:=arOK;
|
||||
aTarget:=TIDECompileTarget(GetNext(true));
|
||||
if aTarget=nil then exit;
|
||||
Result:=aTarget.PerformAction(taCompileFromHere);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1460,7 +1472,7 @@ function TIDECompileTarget.PerformNextTarget(AAction: TPGTargetAction
|
||||
var
|
||||
aTarget: TIDECompileTarget;
|
||||
begin
|
||||
aTarget:=TIDECompileTarget(GetNext);
|
||||
aTarget:=TIDECompileTarget(GetNext(false));
|
||||
while (aTarget<>nil) do
|
||||
begin
|
||||
if AAction in aTarget.AllowedActions then
|
||||
@ -1468,7 +1480,7 @@ begin
|
||||
Result:=aTarget.PerformAction(AAction);
|
||||
exit;
|
||||
end;
|
||||
aTarget:=TIDECompileTarget(aTarget.GetNext);
|
||||
aTarget:=TIDECompileTarget(aTarget.GetNext(false));
|
||||
end;
|
||||
Result:=arOK;
|
||||
end;
|
||||
|
@ -34,6 +34,7 @@ object ProjectGroupEditorForm: TProjectGroupEditorForm
|
||||
Left = 37
|
||||
Top = 2
|
||||
Action = AProjectGroupAddNew
|
||||
Visible = False
|
||||
end
|
||||
object TBDelete: TToolButton
|
||||
Left = 150
|
||||
@ -79,6 +80,7 @@ object ProjectGroupEditorForm: TProjectGroupEditorForm
|
||||
Left = 377
|
||||
Top = 2
|
||||
Action = ATargetActivate
|
||||
Visible = False
|
||||
end
|
||||
end
|
||||
object TVPG: TTreeView
|
||||
|
@ -1,10 +1,11 @@
|
||||
{
|
||||
Todo:
|
||||
- new button: call new item dialog
|
||||
- activate project when project is opened
|
||||
- deactivate project when project is closed
|
||||
- show active build mode
|
||||
- compile a single build mode
|
||||
- Is Activate needed?
|
||||
- Is New button needed?
|
||||
}
|
||||
unit ProjectGroupEditor;
|
||||
|
||||
@ -293,7 +294,7 @@ procedure TProjectGroupEditorForm.ClearEventCallBacks(AProjectGroup: TProjectGro
|
||||
Var
|
||||
PG: TIDEProjectGroup;
|
||||
begin
|
||||
debugln(['TProjectGroupEditorForm.ClearEventCallBacks ']);
|
||||
//debugln(['TProjectGroupEditorForm.ClearEventCallBacks ']);
|
||||
PG:=AProjectGroup as TIDEProjectGroup;
|
||||
PG.RemoveAllHandlersOfObject(Self);
|
||||
PG.OnFileNameChange:=Nil;
|
||||
@ -1293,7 +1294,6 @@ begin
|
||||
CreateSubNode(FileNodes[False],ntFile,T,T.Files[i]);
|
||||
// dependencies
|
||||
ShowDependencies(AParent,T,DepNodes);
|
||||
// TODO: Build mode info Not available ?
|
||||
finally
|
||||
TVPG.EndUpdate;
|
||||
end;
|
||||
|
@ -98,7 +98,7 @@ Type
|
||||
procedure DeActivate;
|
||||
function GetOwnerProjectGroup: TProjectGroup;
|
||||
function GetRootProjectGroup: TProjectGroup;
|
||||
function GetNext: TPGCompileTarget;
|
||||
function GetNext(SkipChildren: boolean): TPGCompileTarget;
|
||||
function IndexOfBuildMode(aName: string): integer;
|
||||
function FindBuildMode(aName: string): TPGBuildMode;
|
||||
procedure Modified; virtual; abstract;
|
||||
@ -545,14 +545,15 @@ begin
|
||||
Result:=aTarget.ProjectGroup;
|
||||
end;
|
||||
|
||||
function TPGCompileTarget.GetNext: TPGCompileTarget;
|
||||
function TPGCompileTarget.GetNext(SkipChildren: boolean): TPGCompileTarget;
|
||||
var
|
||||
aTarget: TPGCompileTarget;
|
||||
PG: TProjectGroup;
|
||||
i: Integer;
|
||||
begin
|
||||
// check first child
|
||||
if (ProjectGroup<>nil) and (ProjectGroup.TargetCount>0) then begin
|
||||
if (not SkipChildren) and (ProjectGroup<>nil) and (ProjectGroup.TargetCount>0)
|
||||
then begin
|
||||
Result:=ProjectGroup.Targets[0];
|
||||
exit(Result);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user