mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 02:59:19 +02:00
IDE: view / IDE internal / what needs building
git-svn-id: trunk@36647 -
This commit is contained in:
parent
c24559db7c
commit
3c6f470562
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -4377,6 +4377,8 @@ ide/idehelpmanager.lfm svneol=native#text/plain
|
|||||||
ide/idehelpmanager.pas svneol=native#text/pascal
|
ide/idehelpmanager.pas svneol=native#text/pascal
|
||||||
ide/ideinfodlg.lfm svneol=native#text/plain
|
ide/ideinfodlg.lfm svneol=native#text/plain
|
||||||
ide/ideinfodlg.pas svneol=native#text/plain
|
ide/ideinfodlg.pas svneol=native#text/plain
|
||||||
|
ide/ideinfoneedbuild.lfm svneol=native#text/plain
|
||||||
|
ide/ideinfoneedbuild.pas svneol=native#text/plain
|
||||||
ide/ideminilibc.pas svneol=native#text/plain
|
ide/ideminilibc.pas svneol=native#text/plain
|
||||||
ide/ideoptiondefs.pas svneol=native#text/pascal
|
ide/ideoptiondefs.pas svneol=native#text/pascal
|
||||||
ide/ideoptionsdlg.lfm svneol=native#text/plain
|
ide/ideoptionsdlg.lfm svneol=native#text/plain
|
||||||
|
@ -6,9 +6,10 @@ object IDEFPCInfoDialog: TIDEFPCInfoDialog
|
|||||||
Caption = 'IDEFPCInfoDialog'
|
Caption = 'IDEFPCInfoDialog'
|
||||||
ClientHeight = 450
|
ClientHeight = 450
|
||||||
ClientWidth = 704
|
ClientWidth = 704
|
||||||
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '1.1'
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 450
|
Height = 450
|
||||||
@ -20,8 +21,8 @@ object IDEFPCInfoDialog: TIDEFPCInfoDialog
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object ValuesTabSheet: TTabSheet
|
object ValuesTabSheet: TTabSheet
|
||||||
Caption = 'FPC values used by the IDE'
|
Caption = 'FPC values used by the IDE'
|
||||||
ClientHeight = 422
|
ClientHeight = 418
|
||||||
ClientWidth = 696
|
ClientWidth = 698
|
||||||
object ValuesMemo: TMemo
|
object ValuesMemo: TMemo
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 422
|
Height = 422
|
||||||
@ -39,13 +40,13 @@ object IDEFPCInfoDialog: TIDEFPCInfoDialog
|
|||||||
end
|
end
|
||||||
object OutputTabSheet: TTabSheet
|
object OutputTabSheet: TTabSheet
|
||||||
Caption = 'FPC output'
|
Caption = 'FPC output'
|
||||||
ClientHeight = 422
|
ClientHeight = 418
|
||||||
ClientWidth = 696
|
ClientWidth = 698
|
||||||
object CmdLineOutputMemo: TMemo
|
object CmdLineOutputMemo: TMemo
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 422
|
Height = 418
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 696
|
Width = 698
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Lines.Strings = (
|
Lines.Strings = (
|
||||||
'CmdLineOutputMemo'
|
'CmdLineOutputMemo'
|
||||||
|
@ -32,7 +32,8 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, AVL_Tree, FileUtil, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, AVL_Tree, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls, ComCtrls, FileProcs, DefineTemplates, CodeToolManager,
|
StdCtrls, ComCtrls, FileProcs, DefineTemplates, CodeToolManager,
|
||||||
BaseBuildManager, Project, EnvironmentOpts, LazarusIDEStrConsts, AboutFrm;
|
BaseBuildManager, Project, EnvironmentOpts, LazarusIDEStrConsts, AboutFrm,
|
||||||
|
IDEWindowIntf;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -44,6 +45,7 @@ type
|
|||||||
PageControl1: TPageControl;
|
PageControl1: TPageControl;
|
||||||
ValuesTabSheet: TTabSheet;
|
ValuesTabSheet: TTabSheet;
|
||||||
OutputTabSheet: TTabSheet;
|
OutputTabSheet: TTabSheet;
|
||||||
|
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
private
|
private
|
||||||
procedure UpdateValuesMemo;
|
procedure UpdateValuesMemo;
|
||||||
@ -84,6 +86,13 @@ begin
|
|||||||
UpdateValuesMemo;
|
UpdateValuesMemo;
|
||||||
UpdateCmdLinePage;
|
UpdateCmdLinePage;
|
||||||
PageControl1.PageIndex:=0;
|
PageControl1.PageIndex:=0;
|
||||||
|
IDEDialogLayoutList.ApplyLayout(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEFPCInfoDialog.FormClose(Sender: TObject;
|
||||||
|
var CloseAction: TCloseAction);
|
||||||
|
begin
|
||||||
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEFPCInfoDialog.UpdateValuesMemo;
|
procedure TIDEFPCInfoDialog.UpdateValuesMemo;
|
||||||
|
@ -6,8 +6,9 @@ object IDEInfoDialog: TIDEInfoDialog
|
|||||||
Caption = 'IDEInfoDialog'
|
Caption = 'IDEInfoDialog'
|
||||||
ClientHeight = 397
|
ClientHeight = 397
|
||||||
ClientWidth = 735
|
ClientWidth = 735
|
||||||
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '1.1'
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 397
|
Height = 397
|
||||||
@ -19,8 +20,8 @@ object IDEInfoDialog: TIDEInfoDialog
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object GeneralTabSheet: TTabSheet
|
object GeneralTabSheet: TTabSheet
|
||||||
Caption = 'General'
|
Caption = 'General'
|
||||||
ClientHeight = 361
|
ClientHeight = 365
|
||||||
ClientWidth = 727
|
ClientWidth = 729
|
||||||
object GeneralMemo: TMemo
|
object GeneralMemo: TMemo
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 361
|
Height = 361
|
||||||
@ -37,8 +38,8 @@ object IDEInfoDialog: TIDEInfoDialog
|
|||||||
end
|
end
|
||||||
object ModifiedTabSheet: TTabSheet
|
object ModifiedTabSheet: TTabSheet
|
||||||
Caption = 'Modified'
|
Caption = 'Modified'
|
||||||
ClientHeight = 361
|
ClientHeight = 365
|
||||||
ClientWidth = 727
|
ClientWidth = 729
|
||||||
object ModifiedMemo: TMemo
|
object ModifiedMemo: TMemo
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 361
|
Height = 361
|
||||||
@ -54,13 +55,13 @@ object IDEInfoDialog: TIDEInfoDialog
|
|||||||
end
|
end
|
||||||
object HelpTabSheet: TTabSheet
|
object HelpTabSheet: TTabSheet
|
||||||
Caption = 'Help'
|
Caption = 'Help'
|
||||||
ClientHeight = 361
|
ClientHeight = 365
|
||||||
ClientWidth = 727
|
ClientWidth = 729
|
||||||
object HelpMemo: TMemo
|
object HelpMemo: TMemo
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 361
|
Height = 365
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 727
|
Width = 729
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Lines.Strings = (
|
Lines.Strings = (
|
||||||
'HelpMemo'
|
'HelpMemo'
|
||||||
|
@ -32,8 +32,8 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
ComCtrls, LCLProc, LazHelpHTML, LazHelpIntf, DefineTemplates, EnvironmentOpts,
|
ComCtrls, LCLProc, LazHelpHTML, LazHelpIntf, DefineTemplates, EnvironmentOpts,
|
||||||
AboutFrm, LazConf, IDEHelpIntf, LazarusIDEStrConsts, Project, SourceEditor,
|
AboutFrm, LazConf, IDEHelpIntf, IDEWindowIntf, LazarusIDEStrConsts, Project,
|
||||||
PackageSystem, PackageDefs;
|
SourceEditor, PackageSystem, PackageDefs;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -47,6 +47,7 @@ type
|
|||||||
GeneralTabSheet: TTabSheet;
|
GeneralTabSheet: TTabSheet;
|
||||||
ModifiedTabSheet: TTabSheet;
|
ModifiedTabSheet: TTabSheet;
|
||||||
HelpTabSheet: TTabSheet;
|
HelpTabSheet: TTabSheet;
|
||||||
|
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
private
|
private
|
||||||
// general
|
// general
|
||||||
@ -99,7 +100,14 @@ begin
|
|||||||
UpdateGeneralMemo;
|
UpdateGeneralMemo;
|
||||||
UpdateModifiedMemo;
|
UpdateModifiedMemo;
|
||||||
UpdateHelpMemo;
|
UpdateHelpMemo;
|
||||||
PageControl1.ActivePage:=GeneralTabSheet;
|
PageControl1.PageIndex:=0;
|
||||||
|
IDEDialogLayoutList.ApplyLayout(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoDialog.FormClose(Sender: TObject;
|
||||||
|
var CloseAction: TCloseAction);
|
||||||
|
begin
|
||||||
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEInfoDialog.GatherHelpDB(Prefix: string;
|
procedure TIDEInfoDialog.GatherHelpDB(Prefix: string;
|
||||||
|
60
ide/ideinfoneedbuild.lfm
Normal file
60
ide/ideinfoneedbuild.lfm
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
object IDEInfoNeedBuildDlg: TIDEInfoNeedBuildDlg
|
||||||
|
Left = 275
|
||||||
|
Height = 434
|
||||||
|
Top = 248
|
||||||
|
Width = 555
|
||||||
|
Caption = 'IDEInfoNeedBuildDlg'
|
||||||
|
ClientHeight = 434
|
||||||
|
ClientWidth = 555
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
Position = poScreenCenter
|
||||||
|
LCLVersion = '1.1'
|
||||||
|
object TargetLabel: TLabel
|
||||||
|
AnchorSideLeft.Control = Owner
|
||||||
|
AnchorSideTop.Control = TargetComboBox
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 6
|
||||||
|
Height = 15
|
||||||
|
Top = 12
|
||||||
|
Width = 65
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Caption = 'TargetLabel'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object TargetComboBox: TComboBox
|
||||||
|
AnchorSideLeft.Control = TargetLabel
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = Owner
|
||||||
|
AnchorSideRight.Control = Owner
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 77
|
||||||
|
Height = 27
|
||||||
|
Top = 6
|
||||||
|
Width = 472
|
||||||
|
Anchors = [akTop, akLeft, akRight]
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
ItemHeight = 0
|
||||||
|
OnChange = TargetComboBoxChange
|
||||||
|
TabOrder = 0
|
||||||
|
Text = 'TargetComboBox'
|
||||||
|
end
|
||||||
|
object MainMemo: TMemo
|
||||||
|
AnchorSideTop.Control = TargetComboBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 6
|
||||||
|
Height = 389
|
||||||
|
Top = 39
|
||||||
|
Width = 543
|
||||||
|
Align = alBottom
|
||||||
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Lines.Strings = (
|
||||||
|
'MainMemo'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
ScrollBars = ssAutoBoth
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
end
|
407
ide/ideinfoneedbuild.pas
Normal file
407
ide/ideinfoneedbuild.pas
Normal file
@ -0,0 +1,407 @@
|
|||||||
|
{
|
||||||
|
***************************************************************************
|
||||||
|
* *
|
||||||
|
* This source is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This code is distributed in the hope that it will be useful, but *
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||||
|
* General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* A copy of the GNU General Public License is available on the World *
|
||||||
|
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||||
|
* obtain it by writing to the Free Software Foundation, *
|
||||||
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
* *
|
||||||
|
***************************************************************************
|
||||||
|
|
||||||
|
Author: Mattias Gaertner
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
IDE dialog showing packages needing rebuild.
|
||||||
|
}
|
||||||
|
unit IDEInfoNeedBuild;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, FileUtil, AvgLvlTree, FileProcs, Forms, Controls, Graphics,
|
||||||
|
Dialogs, StdCtrls,
|
||||||
|
IDEWindowIntf, LazIDEIntf, ProjectIntf,
|
||||||
|
LazarusIDEStrConsts, PackageDefs, PackageSystem, Project, InputHistory,
|
||||||
|
EnvironmentOpts, IDEProcs, BuildManager;
|
||||||
|
|
||||||
|
type
|
||||||
|
TINeedBuild = (
|
||||||
|
inbNone,
|
||||||
|
inbNo,
|
||||||
|
inbNormal,
|
||||||
|
inbClean
|
||||||
|
);
|
||||||
|
|
||||||
|
TInfoNeedBuildItem = class
|
||||||
|
public
|
||||||
|
Target: TObject; // TProject, TLazPackage, LazarusIDE
|
||||||
|
Caption: string;
|
||||||
|
Filename: string;
|
||||||
|
NeedBuild: TINeedBuild;
|
||||||
|
Note: string;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TIDEInfoNeedBuildDlg }
|
||||||
|
|
||||||
|
TIDEInfoNeedBuildDlg = class(TForm)
|
||||||
|
MainMemo: TMemo;
|
||||||
|
TargetComboBox: TComboBox;
|
||||||
|
TargetLabel: TLabel;
|
||||||
|
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure OnIdle(Sender: TObject; var Done: Boolean);
|
||||||
|
procedure TargetComboBoxChange(Sender: TObject);
|
||||||
|
private
|
||||||
|
FIdleConnected: boolean;
|
||||||
|
FMainTarget: TObject;
|
||||||
|
FSkipDesignTimePackages: boolean;
|
||||||
|
FTargetToItem: TAvgLvlTree; // tree of TInfoNeedBuildItem sorted for Target
|
||||||
|
FTargets: TFPList; // topologically sorted list of TInfoNeedBuildItem, last=main
|
||||||
|
procedure FillTargets;
|
||||||
|
function ProjectAsTarget(AProject: TProject): string;
|
||||||
|
function IDEAsTarget: string;
|
||||||
|
procedure SetIdleConnected(AValue: boolean);
|
||||||
|
function CheckNeedBuild(All: boolean): boolean;// true = complete
|
||||||
|
function GetTargets(Target: string): TFPList;
|
||||||
|
function HaveSameTargets(BuildItems, Targets: TFPList): boolean;
|
||||||
|
procedure ClearTargets;
|
||||||
|
procedure SetMainTarget(AValue: TObject);
|
||||||
|
public
|
||||||
|
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
||||||
|
property MainTarget: TObject read FMainTarget write SetMainTarget;
|
||||||
|
property SkipDesignTimePackages: boolean read FSkipDesignTimePackages
|
||||||
|
write FSkipDesignTimePackages;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure ShowNeedBuildDialog;
|
||||||
|
|
||||||
|
function CompareInfoNeedBuildItemWithTargets(Info1, Info2: Pointer): integer;
|
||||||
|
function CompareTargetWithInfoNeedBuildItem(Target, Info: Pointer): integer;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
procedure ShowNeedBuildDialog;
|
||||||
|
var
|
||||||
|
IDEInfoNeedBuildDlg: TIDEInfoNeedBuildDlg;
|
||||||
|
begin
|
||||||
|
IDEInfoNeedBuildDlg:=TIDEInfoNeedBuildDlg.Create(nil);
|
||||||
|
try
|
||||||
|
IDEInfoNeedBuildDlg.ShowModal;
|
||||||
|
finally
|
||||||
|
IDEInfoNeedBuildDlg.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CompareInfoNeedBuildItemWithTargets(Info1, Info2: Pointer): integer;
|
||||||
|
var
|
||||||
|
Item1: TInfoNeedBuildItem absolute Info1;
|
||||||
|
Item2: TInfoNeedBuildItem absolute Info2;
|
||||||
|
begin
|
||||||
|
Result:=ComparePointers(Item1.Target,Item2.Target);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CompareTargetWithInfoNeedBuildItem(Target, Info: Pointer): integer;
|
||||||
|
var
|
||||||
|
Item: TInfoNeedBuildItem absolute Info;
|
||||||
|
begin
|
||||||
|
Result:=ComparePointers(Target,Item.Target);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TIDEInfoNeedBuildDlg }
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
Target: String;
|
||||||
|
begin
|
||||||
|
FTargetToItem:=TAvgLvlTree.Create(@CompareInfoNeedBuildItemWithTargets);
|
||||||
|
FTargets:=TFPList.Create;
|
||||||
|
|
||||||
|
Caption:=lisWhatNeedsRebuilding;
|
||||||
|
|
||||||
|
TargetLabel.Caption:=lisTarget;
|
||||||
|
FillTargets;
|
||||||
|
Target:=InputHistories.ViewNeedBuildTarget;
|
||||||
|
if (Target<>'') and (TargetComboBox.Items.IndexOf(Target)>=0) then
|
||||||
|
TargetComboBox.Text:=Target
|
||||||
|
else
|
||||||
|
TargetComboBox.Text:=TargetComboBox.Items[0];
|
||||||
|
|
||||||
|
IDEDialogLayoutList.ApplyLayout(Self);
|
||||||
|
IdleConnected:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
IdleConnected:=false;
|
||||||
|
ClearTargets;
|
||||||
|
FreeAndNil(FTargetToItem);
|
||||||
|
FreeAndNil(FTargets);
|
||||||
|
MainTarget:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.OnIdle(Sender: TObject; var Done: Boolean);
|
||||||
|
begin
|
||||||
|
if CheckNeedBuild(false) then
|
||||||
|
IdleConnected:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.TargetComboBoxChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
IdleConnected:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.FormClose(Sender: TObject;
|
||||||
|
var CloseAction: TCloseAction);
|
||||||
|
var
|
||||||
|
Target: TCaption;
|
||||||
|
begin
|
||||||
|
IdleConnected:=false;
|
||||||
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
|
Target:=TargetComboBox.Text;
|
||||||
|
if Target=ProjectAsTarget(Project1) then
|
||||||
|
Target:='';
|
||||||
|
InputHistories.ViewNeedBuildTarget:=Target;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.FillTargets;
|
||||||
|
var
|
||||||
|
sl: TStringList;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
sl:=TStringList.Create;
|
||||||
|
try
|
||||||
|
for i:=0 to PackageGraph.Count-1 do
|
||||||
|
sl.Add(PackageGraph[i].Name);
|
||||||
|
sl.Sort;
|
||||||
|
sl.Insert(0,IDEAsTarget);
|
||||||
|
if Project1<>nil then
|
||||||
|
sl.Insert(0,ProjectAsTarget(Project1));
|
||||||
|
TargetComboBox.Items.Assign(sl);
|
||||||
|
finally
|
||||||
|
sl.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDEInfoNeedBuildDlg.ProjectAsTarget(AProject: TProject): string;
|
||||||
|
begin
|
||||||
|
if AProject=nil then
|
||||||
|
Result:=''
|
||||||
|
else
|
||||||
|
Result:=Format(lisProject, [AProject.Title]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDEInfoNeedBuildDlg.IDEAsTarget: string;
|
||||||
|
begin
|
||||||
|
Result:=lisLazarusIDE;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.SetIdleConnected(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if FIdleConnected=AValue then Exit;
|
||||||
|
if AValue and (ComponentState*[csDestroying,csLoading]<>[]) then exit;
|
||||||
|
FIdleConnected:=AValue;
|
||||||
|
if IdleConnected then
|
||||||
|
Application.AddOnIdleHandler(@OnIdle)
|
||||||
|
else
|
||||||
|
Application.RemoveOnIdleHandler(@OnIdle);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDEInfoNeedBuildDlg.CheckNeedBuild(All: boolean): boolean;
|
||||||
|
var
|
||||||
|
NewTargets: TFPList;
|
||||||
|
i: Integer;
|
||||||
|
Item: TInfoNeedBuildItem;
|
||||||
|
s: String;
|
||||||
|
Pkg: TLazPackage;
|
||||||
|
AProject: TProject;
|
||||||
|
NeedBuildAll: boolean;
|
||||||
|
PGNeedBuild: TModalResult;
|
||||||
|
begin
|
||||||
|
NewTargets:=GetTargets(TargetComboBox.Text);
|
||||||
|
try
|
||||||
|
if not HaveSameTargets(FTargets,NewTargets) then begin
|
||||||
|
// targets have changed
|
||||||
|
ClearTargets;
|
||||||
|
if NewTargets=nil then exit(true);
|
||||||
|
SkipDesignTimePackages:=false;
|
||||||
|
for i:=0 to NewTargets.Count-1 do begin
|
||||||
|
Item:=TInfoNeedBuildItem.Create;
|
||||||
|
Item.Target:=TObject(NewTargets[i]);
|
||||||
|
if Item.Target=LazarusIDE then begin
|
||||||
|
Item.Caption:=IDEAsTarget;
|
||||||
|
Item.Filename:=EnvironmentOptions.LazarusDirectory;
|
||||||
|
end
|
||||||
|
else if Item.Target is TProject then begin
|
||||||
|
AProject:=TProject(Item.Target);
|
||||||
|
Item.Caption:=ProjectAsTarget(AProject);
|
||||||
|
Item.Filename:=AProject.ProjectInfoFile;
|
||||||
|
SkipDesignTimePackages:=not (pfUseDesignTimePackages in AProject.Flags);
|
||||||
|
end
|
||||||
|
else if Item.Target is TLazPackage then begin
|
||||||
|
Pkg:=TLazPackage(Item.Target);
|
||||||
|
Item.Caption:=Pkg.IDAsString;
|
||||||
|
Item.Filename:=Pkg.Filename;
|
||||||
|
end;
|
||||||
|
FTargetToItem.Add(Item);
|
||||||
|
FTargets.Add(Item);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
NewTargets.Free;
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
|
||||||
|
// check
|
||||||
|
if (FTargets.Count>0) then
|
||||||
|
MainTarget:=TObject(FTargets.Last);
|
||||||
|
|
||||||
|
i:=0;
|
||||||
|
while i<FTargets.Count do begin
|
||||||
|
Item:=TInfoNeedBuildItem(FTargets[i]);
|
||||||
|
if Item.NeedBuild=inbNone then begin
|
||||||
|
Item.NeedBuild:=inbNo;
|
||||||
|
if Item.Target=LazarusIDE then begin
|
||||||
|
// no check available
|
||||||
|
end
|
||||||
|
else if Item.Target is TProject then begin
|
||||||
|
// ToDo
|
||||||
|
|
||||||
|
end
|
||||||
|
else if Item.Target is TLazPackage then begin
|
||||||
|
Pkg:=TLazPackage(Item.Target);
|
||||||
|
Item.Note:='';
|
||||||
|
PGNeedBuild:=PackageGraph.CheckIfPackageNeedsCompilation(
|
||||||
|
Pkg,SkipDesignTimePackages,NeedBuildAll,Item.Note);
|
||||||
|
if PGNeedBuild=mrYes then begin
|
||||||
|
if NeedBuildAll then
|
||||||
|
Item.NeedBuild:=inbClean
|
||||||
|
else
|
||||||
|
Item.NeedBuild:=inbNormal;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if not All then break;
|
||||||
|
end;
|
||||||
|
inc(i);
|
||||||
|
end;
|
||||||
|
Result:=i=FTargets.Count; // true = all checked
|
||||||
|
|
||||||
|
// update memo
|
||||||
|
s:='';
|
||||||
|
for i:=0 to FTargets.Count-1 do begin
|
||||||
|
Item:=TInfoNeedBuildItem(FTargets[i]);
|
||||||
|
s+='Target: '+Item.Caption+LineEnding;
|
||||||
|
case Item.NeedBuild of
|
||||||
|
inbNone: s+='checking ...';
|
||||||
|
inbNo: s+='No build needed.';
|
||||||
|
inbNormal: s+='Build needed.';
|
||||||
|
inbClean: s+='Clean build needed.';
|
||||||
|
end;
|
||||||
|
s+=LineEnding;
|
||||||
|
if Item.Filename<>'' then
|
||||||
|
s+='File: '+Item.Filename+LineEnding;
|
||||||
|
if Item.Note<>'' then
|
||||||
|
s+='Note: '+Item.Note+LineEnding;
|
||||||
|
s+=LineEnding;
|
||||||
|
end;
|
||||||
|
MainMemo.Lines.Text:=s;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDEInfoNeedBuildDlg.GetTargets(Target: string): TFPList;
|
||||||
|
|
||||||
|
function GetList(Main: TObject; FirstDependency: TPkgDependency): TFPList;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
if Main=nil then exit;
|
||||||
|
PackageGraph.GetAllRequiredPackages(FirstDependency,Result);
|
||||||
|
if Result<>nil then begin
|
||||||
|
// PackageGraph.GetAllRequiredPackages starts with the inner nodes
|
||||||
|
// => reverse order
|
||||||
|
ReverseList(Result);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result:=TFPList.Create;
|
||||||
|
Result.Add(Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Pkg: TLazPackage;
|
||||||
|
begin
|
||||||
|
if Target=IDEAsTarget then begin
|
||||||
|
Result:=GetList(LazarusIDE,PackageGraph.FirstAutoInstallDependency);
|
||||||
|
end else if Target=ProjectAsTarget(Project1) then begin
|
||||||
|
Result:=GetList(Project1,Project1.FirstRequiredDependency);
|
||||||
|
end else begin
|
||||||
|
Pkg:=PackageGraph.FindPackageWithName(Target,nil);
|
||||||
|
Result:=GetList(Pkg,Pkg.FirstRequiredDependency);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDEInfoNeedBuildDlg.HaveSameTargets(BuildItems, Targets: TFPList
|
||||||
|
): boolean;
|
||||||
|
// check if BuildItems and Targets have the same targets
|
||||||
|
var
|
||||||
|
Targets1: TFPList;
|
||||||
|
Targets2: TFPList;
|
||||||
|
i: Integer;
|
||||||
|
Target: TObject;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
if (BuildItems=nil)<>(Targets=nil) then exit;
|
||||||
|
Targets1:=TFPList.Create;
|
||||||
|
Targets2:=TFPList.Create;
|
||||||
|
try
|
||||||
|
// create a list of targets from BuildItems and a second list from Targets
|
||||||
|
for i:=0 to BuildItems.Count-1 do
|
||||||
|
Targets1.Add(TInfoNeedBuildItem(BuildItems[i]).Target);
|
||||||
|
for i:=0 to Targets.Count-1 do begin
|
||||||
|
Target:=TObject(Targets[i]);
|
||||||
|
if (Target=LazarusIDE) or (Target is TProject) or (Target is TLazPackage) then
|
||||||
|
Targets2.Add(Target);
|
||||||
|
end;
|
||||||
|
if Targets1.Count<>Targets2.Count then exit;
|
||||||
|
// sort both lists
|
||||||
|
Targets1.Sort(@ComparePointers);
|
||||||
|
Targets2.Sort(@ComparePointers);
|
||||||
|
// compare each item
|
||||||
|
for i:=0 to Targets1.Count-1 do
|
||||||
|
if Targets1[i]<>Targets2[i] then exit;
|
||||||
|
finally
|
||||||
|
Targets1.Free;
|
||||||
|
Targets2.Free;
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.ClearTargets;
|
||||||
|
begin
|
||||||
|
FTargetToItem.FreeAndClear;
|
||||||
|
FTargets.Clear;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInfoNeedBuildDlg.SetMainTarget(AValue: TObject);
|
||||||
|
begin
|
||||||
|
if FMainTarget=AValue then Exit;
|
||||||
|
FMainTarget:=AValue;
|
||||||
|
if (FMainTarget=LazarusIDE) then
|
||||||
|
MainBuildBoss.SetBuildTargetIDE
|
||||||
|
else
|
||||||
|
MainBuildBoss.SetBuildTargetProject1(true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -209,6 +209,7 @@ type
|
|||||||
FLastConvertDelphiPackage: string;
|
FLastConvertDelphiPackage: string;
|
||||||
FLastConvertDelphiProject: string;
|
FLastConvertDelphiProject: string;
|
||||||
FLastConvertDelphiUnit: string;
|
FLastConvertDelphiUnit: string;
|
||||||
|
FViewNeedBuildTarget: string;
|
||||||
FNewFileType: string;
|
FNewFileType: string;
|
||||||
FNewProjectType: string;
|
FNewProjectType: string;
|
||||||
FReplaceHistory: TStringList;
|
FReplaceHistory: TStringList;
|
||||||
@ -313,6 +314,10 @@ type
|
|||||||
write FLastConvertDelphiPackage;
|
write FLastConvertDelphiPackage;
|
||||||
property LastConvertDelphiUnit: string read FLastConvertDelphiUnit
|
property LastConvertDelphiUnit: string read FLastConvertDelphiUnit
|
||||||
write FLastConvertDelphiUnit;
|
write FLastConvertDelphiUnit;
|
||||||
|
|
||||||
|
// View / internals
|
||||||
|
property ViewNeedBuildTarget: string read FViewNeedBuildTarget
|
||||||
|
write FViewNeedBuildTarget;
|
||||||
|
|
||||||
// file encodings
|
// file encodings
|
||||||
property FileEncodings: TStringToStringTree read fFileEncodings write fFileEncodings;
|
property FileEncodings: TStringToStringTree read fFileEncodings write fFileEncodings;
|
||||||
@ -558,6 +563,9 @@ begin
|
|||||||
FLastConvertDelphiPackage:=XMLConfig.GetValue(Path+'Conversion/Delphi/Package','');
|
FLastConvertDelphiPackage:=XMLConfig.GetValue(Path+'Conversion/Delphi/Package','');
|
||||||
FLastConvertDelphiUnit:=XMLConfig.GetValue(Path+'Conversion/Delphi/Unit','');
|
FLastConvertDelphiUnit:=XMLConfig.GetValue(Path+'Conversion/Delphi/Unit','');
|
||||||
|
|
||||||
|
// view internals
|
||||||
|
ViewNeedBuildTarget:=XMLConfig.GetValue(Path+'View/NeedBuild/Target','');
|
||||||
|
|
||||||
// encodings
|
// encodings
|
||||||
LoadStringToStringTree(XMLConfig,fFileEncodings,Path+'FileEncodings/');
|
LoadStringToStringTree(XMLConfig,fFileEncodings,Path+'FileEncodings/');
|
||||||
|
|
||||||
@ -632,6 +640,10 @@ begin
|
|||||||
FLastConvertDelphiPackage,'');
|
FLastConvertDelphiPackage,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'Conversion/Delphi/Unit',
|
XMLConfig.SetDeleteValue(Path+'Conversion/Delphi/Unit',
|
||||||
FLastConvertDelphiUnit,'');
|
FLastConvertDelphiUnit,'');
|
||||||
|
|
||||||
|
// view internals
|
||||||
|
XMLConfig.SetDeleteValue(Path+'View/NeedBuild/Target',ViewNeedBuildTarget,'');
|
||||||
|
|
||||||
// encodings
|
// encodings
|
||||||
SaveStringToStringTree(XMLConfig,fFileEncodings,Path+'FileEncodings/');
|
SaveStringToStringTree(XMLConfig,fFileEncodings,Path+'FileEncodings/');
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
<PackageName Value="SynEdit"/>
|
<PackageName Value="SynEdit"/>
|
||||||
</Item6>
|
</Item6>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="90">
|
<Units Count="91">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="lazarus.pp"/>
|
<Filename Value="lazarus.pp"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -552,6 +552,7 @@
|
|||||||
<Filename Value="idefpcinfo.pas"/>
|
<Filename Value="idefpcinfo.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ComponentName Value="IDEFPCInfoDialog"/>
|
<ComponentName Value="IDEFPCInfoDialog"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="IDEFPCInfo"/>
|
<UnitName Value="IDEFPCInfo"/>
|
||||||
</Unit71>
|
</Unit71>
|
||||||
@ -573,6 +574,7 @@
|
|||||||
<Filename Value="ideinfodlg.pas"/>
|
<Filename Value="ideinfodlg.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ComponentName Value="IDEInfoDialog"/>
|
<ComponentName Value="IDEInfoDialog"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="IDEInfoDlg"/>
|
<UnitName Value="IDEInfoDlg"/>
|
||||||
</Unit74>
|
</Unit74>
|
||||||
@ -676,6 +678,13 @@
|
|||||||
<ResourceBaseClass Value="Frame"/>
|
<ResourceBaseClass Value="Frame"/>
|
||||||
<UnitName Value="editor_multiwindow_options"/>
|
<UnitName Value="editor_multiwindow_options"/>
|
||||||
</Unit89>
|
</Unit89>
|
||||||
|
<Unit90>
|
||||||
|
<Filename Value="ideinfoneedbuild.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="IDEInfoNeedBuildDlg"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="IDEInfoNeedBuild"/>
|
||||||
|
</Unit90>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
@ -366,6 +366,7 @@ resourcestring
|
|||||||
lisMenuPackageLinks = 'Package Links ...';
|
lisMenuPackageLinks = 'Package Links ...';
|
||||||
lisMenuAboutFPC = 'About FPC';
|
lisMenuAboutFPC = 'About FPC';
|
||||||
lisAboutIDE = 'About IDE';
|
lisAboutIDE = 'About IDE';
|
||||||
|
lisMenuWhatNeedsBuilding = 'What Needs Building';
|
||||||
|
|
||||||
lisMenuNewProject = 'New Project ...';
|
lisMenuNewProject = 'New Project ...';
|
||||||
lisMenuNewProjectFromFile = 'New Project from File ...';
|
lisMenuNewProjectFromFile = 'New Project from File ...';
|
||||||
@ -4607,6 +4608,9 @@ resourcestring
|
|||||||
lisUIClearIncludedByReference = 'Clear include cache';
|
lisUIClearIncludedByReference = 'Clear include cache';
|
||||||
lisChangeParent = 'Change Parent';
|
lisChangeParent = 'Change Parent';
|
||||||
lisLazarusIDE = 'Lazarus IDE';
|
lisLazarusIDE = 'Lazarus IDE';
|
||||||
|
lisProject = 'Project %s';
|
||||||
|
lisWhatNeedsRebuilding = 'What needs rebuilding';
|
||||||
|
lisTarget = 'Target:';
|
||||||
lisDirectives = 'Directives';
|
lisDirectives = 'Directives';
|
||||||
|
|
||||||
//conditional defines dialog
|
//conditional defines dialog
|
||||||
|
@ -145,7 +145,7 @@ uses
|
|||||||
OutputFilter, JumpHistoryView, ManageExamples,
|
OutputFilter, JumpHistoryView, ManageExamples,
|
||||||
BuildLazDialog, BuildProfileManager, BuildManager, CheckCompOptsForNewUnitDlg,
|
BuildLazDialog, BuildProfileManager, BuildManager, CheckCompOptsForNewUnitDlg,
|
||||||
MiscOptions, InputHistory, UnitDependencies, ClipBoardHistory,
|
MiscOptions, InputHistory, UnitDependencies, ClipBoardHistory,
|
||||||
IDEFPCInfo, IDEInfoDlg, ProcessList, InitialSetupDlgs,
|
IDEFPCInfo, IDEInfoDlg, IDEInfoNeedBuild, ProcessList, InitialSetupDlgs,
|
||||||
NewDialog, MakeResStrDlg, DialogProcs, FindReplaceDialog, FindInFilesDlg,
|
NewDialog, MakeResStrDlg, DialogProcs, FindReplaceDialog, FindInFilesDlg,
|
||||||
CodeExplorer, BuildFileDlg, ProcedureList, ExtractProcDlg,
|
CodeExplorer, BuildFileDlg, ProcedureList, ExtractProcDlg,
|
||||||
FindRenameIdentifier, AbstractsMethodsDlg, EmptyMethodsDlg, UnusedUnitsDlg,
|
FindRenameIdentifier, AbstractsMethodsDlg, EmptyMethodsDlg, UnusedUnitsDlg,
|
||||||
@ -261,6 +261,7 @@ type
|
|||||||
procedure mnuViewIDESpeedButtonsClicked(Sender: TObject);
|
procedure mnuViewIDESpeedButtonsClicked(Sender: TObject);
|
||||||
procedure mnuViewFPCInfoClicked(Sender: TObject);
|
procedure mnuViewFPCInfoClicked(Sender: TObject);
|
||||||
procedure mnuViewIDEInfoClicked(Sender: TObject);
|
procedure mnuViewIDEInfoClicked(Sender: TObject);
|
||||||
|
procedure mnuViewNeedBuildClicked(Sender: TObject);
|
||||||
|
|
||||||
// source menu
|
// source menu
|
||||||
procedure mnuSourceClicked(Sender: TObject);
|
procedure mnuSourceClicked(Sender: TObject);
|
||||||
@ -2599,6 +2600,7 @@ begin
|
|||||||
|
|
||||||
itmViewFPCInfo.OnClick:=@mnuViewFPCInfoClicked;
|
itmViewFPCInfo.OnClick:=@mnuViewFPCInfoClicked;
|
||||||
itmViewIDEInfo.OnClick:=@mnuViewIDEInfoClicked;
|
itmViewIDEInfo.OnClick:=@mnuViewIDEInfoClicked;
|
||||||
|
itmViewNeedBuild.OnClick:=@mnuViewNeedBuildClicked;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2800,6 +2802,11 @@ begin
|
|||||||
ShowIDEInfo;
|
ShowIDEInfo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainIDE.mnuViewNeedBuildClicked(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ShowNeedBuildDialog;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.SetDesigning(AComponent: TComponent; Value: Boolean);
|
procedure TMainIDE.SetDesigning(AComponent: TComponent; Value: Boolean);
|
||||||
begin
|
begin
|
||||||
SetComponentDesignMode(AComponent, Value);
|
SetComponentDesignMode(AComponent, Value);
|
||||||
|
@ -196,6 +196,7 @@ type
|
|||||||
itmViewPackageLinks: TIDEMenuCommand;
|
itmViewPackageLinks: TIDEMenuCommand;
|
||||||
itmViewFPCInfo: TIDEMenuCommand;
|
itmViewFPCInfo: TIDEMenuCommand;
|
||||||
itmViewIDEInfo: TIDEMenuCommand;
|
itmViewIDEInfo: TIDEMenuCommand;
|
||||||
|
itmViewNeedBuild: TIDEMenuCommand;
|
||||||
itmSearchInFPDocFiles: TIDEMenuCommand;
|
itmSearchInFPDocFiles: TIDEMenuCommand;
|
||||||
|
|
||||||
// source menu
|
// source menu
|
||||||
|
@ -537,6 +537,7 @@ begin
|
|||||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks);
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks);
|
||||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewFPCInfo, 'itmViewFPCInfo', lisMenuAboutFPC);
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewFPCInfo, 'itmViewFPCInfo', lisMenuAboutFPC);
|
||||||
CreateMenuItem(itmViewIDEInternalsWindows, itmViewIDEInfo, 'itmViewIDEInfo', lisAboutIDE);
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewIDEInfo, 'itmViewIDEInfo', lisAboutIDE);
|
||||||
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewNeedBuild, 'itmViewNeedBuild', lisMenuWhatNeedsBuilding);
|
||||||
{$IFDEF EnableFPDocSearch}
|
{$IFDEF EnableFPDocSearch}
|
||||||
CreateMenuItem(itmViewIDEInternalsWindows, itmSearchInFPDocFiles, 'itmSearchInFPDocFiles',
|
CreateMenuItem(itmViewIDEInternalsWindows, itmSearchInFPDocFiles, 'itmSearchInFPDocFiles',
|
||||||
'Search in FPDoc files');
|
'Search in FPDoc files');
|
||||||
|
@ -146,7 +146,8 @@ type
|
|||||||
function GetPackageCompilerParams(APackage: TLazPackage): string;
|
function GetPackageCompilerParams(APackage: TLazPackage): string;
|
||||||
function CheckIfCurPkgOutDirNeedsCompile(APackage: TLazPackage;
|
function CheckIfCurPkgOutDirNeedsCompile(APackage: TLazPackage;
|
||||||
CheckDependencies, SkipDesignTimePackages: boolean;
|
CheckDependencies, SkipDesignTimePackages: boolean;
|
||||||
out NeedBuildAllFlag, ConfigChanged, DependenciesChanged: boolean): TModalResult;
|
out NeedBuildAllFlag, ConfigChanged, DependenciesChanged: boolean;
|
||||||
|
var Note: string): TModalResult;
|
||||||
procedure InvalidateStateFile(APackage: TLazPackage);
|
procedure InvalidateStateFile(APackage: TLazPackage);
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
@ -290,7 +291,7 @@ type
|
|||||||
): TModalResult;
|
): TModalResult;
|
||||||
function CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
function CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
||||||
SkipDesignTimePackages: boolean;
|
SkipDesignTimePackages: boolean;
|
||||||
out NeedBuildAllFlag: boolean): TModalResult;
|
out NeedBuildAllFlag: boolean; var Note: string): TModalResult;
|
||||||
function PreparePackageOutputDirectory(APackage: TLazPackage;
|
function PreparePackageOutputDirectory(APackage: TLazPackage;
|
||||||
CleanUp: boolean): TModalResult;
|
CleanUp: boolean): TModalResult;
|
||||||
function GetFallbackOutputDir(APackage: TLazPackage): string;
|
function GetFallbackOutputDir(APackage: TLazPackage): string;
|
||||||
@ -2853,7 +2854,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
function TLazPackageGraph.CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
||||||
SkipDesignTimePackages: boolean; out NeedBuildAllFlag: boolean): TModalResult;
|
SkipDesignTimePackages: boolean; out NeedBuildAllFlag: boolean; var
|
||||||
|
Note: string): TModalResult;
|
||||||
var
|
var
|
||||||
OutputDir: String;
|
OutputDir: String;
|
||||||
NewOutputDir: String;
|
NewOutputDir: String;
|
||||||
@ -2869,12 +2871,13 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
NeedBuildAllFlag:=false;
|
NeedBuildAllFlag:=false;
|
||||||
|
|
||||||
if APackage.AutoUpdate=pupManually then exit(mrNo);
|
if APackage.AutoUpdate=pupManually then
|
||||||
|
exit(mrNo);
|
||||||
|
|
||||||
// check the current output directory
|
// check the current output directory
|
||||||
Result:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
Result:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
||||||
true,SkipDesignTimePackages,
|
true,SkipDesignTimePackages,
|
||||||
NeedBuildAllFlag,ConfigChanged,DependenciesChanged);
|
NeedBuildAllFlag,ConfigChanged,DependenciesChanged,Note);
|
||||||
if Result=mrNo then exit; // the current output is valid
|
if Result=mrNo then exit; // the current output is valid
|
||||||
|
|
||||||
// the current output directory needs compilation
|
// the current output directory needs compilation
|
||||||
@ -2888,6 +2891,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
debugln(['TLazPackageGraph.CheckIfPackageNeedsCompilation normal output dir is not writable: ',OutputDir]);
|
debugln(['TLazPackageGraph.CheckIfPackageNeedsCompilation normal output dir is not writable: ',OutputDir]);
|
||||||
|
Note+='Normal output directory is not writable.'+LineEnding;
|
||||||
// the normal output directory is not writable
|
// the normal output directory is not writable
|
||||||
// => try the fallback directory
|
// => try the fallback directory
|
||||||
NewOutputDir:=GetFallbackOutputDir(APackage);
|
NewOutputDir:=GetFallbackOutputDir(APackage);
|
||||||
@ -2895,7 +2899,7 @@ begin
|
|||||||
APackage.CompilerOptions.ParsedOpts.OutputDirectoryOverride:=NewOutputDir;
|
APackage.CompilerOptions.ParsedOpts.OutputDirectoryOverride:=NewOutputDir;
|
||||||
Result:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
Result:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
||||||
true,SkipDesignTimePackages,
|
true,SkipDesignTimePackages,
|
||||||
NeedBuildAllFlag,ConfigChanged,DependenciesChanged);
|
NeedBuildAllFlag,ConfigChanged,DependenciesChanged,Note);
|
||||||
end else begin
|
end else begin
|
||||||
// the last compile was put to the fallback output directory
|
// the last compile was put to the fallback output directory
|
||||||
if not ConfigChanged then begin
|
if not ConfigChanged then begin
|
||||||
@ -2916,10 +2920,11 @@ begin
|
|||||||
OldNeedBuildAllFlag:=NeedBuildAllFlag;
|
OldNeedBuildAllFlag:=NeedBuildAllFlag;
|
||||||
DefResult:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
DefResult:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
||||||
true,SkipDesignTimePackages,
|
true,SkipDesignTimePackages,
|
||||||
NeedBuildAllFlag,ConfigChanged,DependenciesChanged);
|
NeedBuildAllFlag,ConfigChanged,DependenciesChanged,Note);
|
||||||
if DefResult=mrNo then begin
|
if DefResult=mrNo then begin
|
||||||
// switching back to the not writable output directory requires no compile
|
// switching back to the not writable output directory requires no compile
|
||||||
debugln(['TLazPackageGraph.CheckIfPackageNeedsCompilation switching back to the normal output directory: ',APackage.GetOutputDirectory]);
|
debugln(['TLazPackageGraph.CheckIfPackageNeedsCompilation switching back to the normal output directory: ',APackage.GetOutputDirectory]);
|
||||||
|
Note+='Switching back to not writable output directory.'+LineEnding;
|
||||||
exit(mrNo);
|
exit(mrNo);
|
||||||
end;
|
end;
|
||||||
// neither the default nor the fallback is valid
|
// neither the default nor the fallback is valid
|
||||||
@ -2930,10 +2935,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile(
|
function TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile(
|
||||||
APackage: TLazPackage;
|
APackage: TLazPackage; CheckDependencies, SkipDesignTimePackages: boolean;
|
||||||
CheckDependencies, SkipDesignTimePackages: boolean;
|
out NeedBuildAllFlag, ConfigChanged, DependenciesChanged: boolean;
|
||||||
out NeedBuildAllFlag,
|
var Note: string): TModalResult;
|
||||||
ConfigChanged, DependenciesChanged: boolean): TModalResult;
|
|
||||||
// returns: mrYes, mrNo, mrCancel, mrAbort
|
// returns: mrYes, mrNo, mrCancel, mrAbort
|
||||||
var
|
var
|
||||||
StateFilename: String;
|
StateFilename: String;
|
||||||
@ -2987,6 +2991,7 @@ begin
|
|||||||
if not Stats^.StateFileLoaded then begin
|
if not Stats^.StateFileLoaded then begin
|
||||||
// package was not compiled via Lazarus nor via Makefile
|
// package was not compiled via Lazarus nor via Makefile
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Missing state file for ',APackage.IDAsString,': ',StateFilename);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Missing state file for ',APackage.IDAsString,': ',StateFilename);
|
||||||
|
Note+='Missing state file "'+StateFilename+'".'+LineEnding;
|
||||||
ConfigChanged:=true;
|
ConfigChanged:=true;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
@ -3010,6 +3015,9 @@ begin
|
|||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler custom params changed for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler custom params changed for ',APackage.IDAsString);
|
||||||
DebugLn(' Old="',OldValue,'"');
|
DebugLn(' Old="',OldValue,'"');
|
||||||
DebugLn(' Now="',NewValue,'"');
|
DebugLn(' Now="',NewValue,'"');
|
||||||
|
Note+='Compiler custom parameters changed:'+LineEnding
|
||||||
|
+' Old="'+OldValue+'"'+LineEnding
|
||||||
|
+' Now="'+NewValue+'"'+LineEnding;
|
||||||
ConfigChanged:=true;
|
ConfigChanged:=true;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
@ -3020,6 +3028,9 @@ begin
|
|||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler unit paths changed for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler unit paths changed for ',APackage.IDAsString);
|
||||||
DebugLn(' Old="',OldValue,'"');
|
DebugLn(' Old="',OldValue,'"');
|
||||||
DebugLn(' Now="',NewValue,'"');
|
DebugLn(' Now="',NewValue,'"');
|
||||||
|
Note+='Compiler unit paths changed:'+LineEnding
|
||||||
|
+' Old="'+OldValue+'"'+LineEnding
|
||||||
|
+' Now="'+NewValue+'"'+LineEnding;
|
||||||
ConfigChanged:=true;
|
ConfigChanged:=true;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
@ -3030,6 +3041,9 @@ begin
|
|||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler include paths changed for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler include paths changed for ',APackage.IDAsString);
|
||||||
DebugLn(' Old="',OldValue,'"');
|
DebugLn(' Old="',OldValue,'"');
|
||||||
DebugLn(' Now="',NewValue,'"');
|
DebugLn(' Now="',NewValue,'"');
|
||||||
|
Note+='Compiler include paths changed:'+LineEnding
|
||||||
|
+' Old="'+OldValue+'"'+LineEnding
|
||||||
|
+' Now="'+NewValue+'"'+LineEnding;
|
||||||
ConfigChanged:=true;
|
ConfigChanged:=true;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
@ -3042,6 +3056,9 @@ begin
|
|||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler params changed for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler params changed for ',APackage.IDAsString);
|
||||||
DebugLn(' Old="',LastParams,'"');
|
DebugLn(' Old="',LastParams,'"');
|
||||||
DebugLn(' Now="',CompilerParams,'"');
|
DebugLn(' Now="',CompilerParams,'"');
|
||||||
|
Note+='Compiler parameters changed:'+LineEnding
|
||||||
|
+' Old="'+OldValue+'"'+LineEnding
|
||||||
|
+' Now="'+NewValue+'"'+LineEnding;
|
||||||
ConfigChanged:=true;
|
ConfigChanged:=true;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
@ -3050,26 +3067,40 @@ begin
|
|||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler filename changed for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler filename changed for ',APackage.IDAsString);
|
||||||
DebugLn(' Old="',Stats^.CompilerFilename,'"');
|
DebugLn(' Old="',Stats^.CompilerFilename,'"');
|
||||||
DebugLn(' Now="',CompilerFilename,'"');
|
DebugLn(' Now="',CompilerFilename,'"');
|
||||||
|
Note+='Compiler filename changed:'+LineEnding
|
||||||
|
+' Old="'+Stats^.CompilerFilename+'"'+LineEnding
|
||||||
|
+' Now="'+CompilerFilename+'"'+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
if not FileExistsCached(CompilerFilename) then begin
|
if not FileExistsCached(CompilerFilename) then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler filename not found for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler filename not found for ',APackage.IDAsString);
|
||||||
DebugLn(' File="',CompilerFilename,'"');
|
DebugLn(' File="',CompilerFilename,'"');
|
||||||
|
Note+='Compiler file "'+CompilerFilename+'" not found.'+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
if (not Stats^.ViaMakefile)
|
if (not Stats^.ViaMakefile)
|
||||||
and (FileAgeCached(CompilerFilename)<>Stats^.CompilerFileDate) then begin
|
and (FileAgeCached(CompilerFilename)<>Stats^.CompilerFileDate) then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler file changed for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compiler file changed for ',APackage.IDAsString);
|
||||||
DebugLn(' File="',CompilerFilename,'"');
|
DebugLn(' File="',CompilerFilename,'"');
|
||||||
|
Note+='Compiler file "'+CompilerFilename+'" changed:'+LineEnding
|
||||||
|
+' Old='+FileAgeToStr(Stats^.CompilerFileDate)+LineEnding
|
||||||
|
+' Now='+FileAgeToStr(FileAgeCached(CompilerFilename))+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// check main source file
|
// check main source file
|
||||||
if (SrcFilename<>'') then
|
if (SrcFilename<>'') then
|
||||||
begin
|
begin
|
||||||
if (not FileExistsCached(SrcFilename)) or (StateFileAge<FileAgeUTF8(SrcFilename))
|
if not FileExistsCached(SrcFilename) then begin
|
||||||
then begin
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile SrcFile missing of ',APackage.IDAsString,': ',SrcFilename);
|
||||||
|
Note+='Source file "'+SrcFilename+'" missing.'+LineEnding;
|
||||||
|
exit(mrYes);
|
||||||
|
end;
|
||||||
|
if StateFileAge<FileAgeCached(SrcFilename) then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile SrcFile outdated of ',APackage.IDAsString,': ',SrcFilename);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile SrcFile outdated of ',APackage.IDAsString,': ',SrcFilename);
|
||||||
|
Note+='Source file "'+SrcFilename+'" outdated:'+LineEnding
|
||||||
|
+' state file age='+FileAgeToStr(StateFileAge)+LineEnding
|
||||||
|
+' source file age='+FileAgeToStr(FileAgeCached(SrcFilename))+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
// check main source ppu file
|
// check main source ppu file
|
||||||
@ -3077,6 +3108,7 @@ begin
|
|||||||
SrcPPUFile:=APackage.GetSrcPPUFilename;
|
SrcPPUFile:=APackage.GetSrcPPUFilename;
|
||||||
if not FileExistsCached(SrcPPUFile) then begin
|
if not FileExistsCached(SrcPPUFile) then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile main ppu file missing of ',APackage.IDAsString,': ',SrcPPUFile);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile main ppu file missing of ',APackage.IDAsString,': ',SrcPPUFile);
|
||||||
|
Note+='Main ppu file "'+SrcPPUFile+'" missing.'+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3091,6 +3123,7 @@ begin
|
|||||||
|
|
||||||
if not Stats^.Complete then begin
|
if not Stats^.Complete then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compile was incomplete for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Compile was incomplete for ',APackage.IDAsString);
|
||||||
|
Note+='Last compile was incomplete.'+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3107,6 +3140,9 @@ begin
|
|||||||
// check package files
|
// check package files
|
||||||
if StateFileAge<FileAgeCached(APackage.Filename) then begin
|
if StateFileAge<FileAgeCached(APackage.Filename) then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile StateFile older than lpk ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile StateFile older than lpk ',APackage.IDAsString);
|
||||||
|
Note+='State file older than lpk:'+LineEnding
|
||||||
|
+' state file age='+FileAgeToStr(StateFileAge)+LineEnding
|
||||||
|
+' lpk age='+FileAgeToStr(FileAgeCached(APackage.Filename))+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
for i:=0 to APackage.FileCount-1 do begin
|
for i:=0 to APackage.FileCount-1 do begin
|
||||||
@ -3116,6 +3152,9 @@ begin
|
|||||||
if FileExistsCached(AFilename)
|
if FileExistsCached(AFilename)
|
||||||
and (StateFileAge<FileAgeCached(AFilename)) then begin
|
and (StateFileAge<FileAgeCached(AFilename)) then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Src has changed ',APackage.IDAsString,' ',CurFile.Filename);
|
DebugLn('TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Src has changed ',APackage.IDAsString,' ',CurFile.Filename);
|
||||||
|
Note+='State file older than source "'+AFilename+'"'+LineEnding
|
||||||
|
+' state file age='+FileAgeToStr(StateFileAge)+LineEnding
|
||||||
|
+' lpk age='+FileAgeToStr(FileAgeCached(APackage.Filename))+LineEnding;
|
||||||
exit(mrYes);
|
exit(mrYes);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3187,6 +3226,7 @@ var
|
|||||||
SrcPPUFile: String;
|
SrcPPUFile: String;
|
||||||
SrcPPUFileExists: Boolean;
|
SrcPPUFileExists: Boolean;
|
||||||
CompilerParams: String;
|
CompilerParams: String;
|
||||||
|
Note: String;
|
||||||
begin
|
begin
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
|
|
||||||
@ -3215,9 +3255,10 @@ begin
|
|||||||
|
|
||||||
// check if compilation is needed and if a clean build is needed
|
// check if compilation is needed and if a clean build is needed
|
||||||
NeedBuildAllFlag:=false;
|
NeedBuildAllFlag:=false;
|
||||||
|
Note:='';
|
||||||
Result:=CheckIfPackageNeedsCompilation(APackage,
|
Result:=CheckIfPackageNeedsCompilation(APackage,
|
||||||
pcfSkipDesignTimePackages in Flags,
|
pcfSkipDesignTimePackages in Flags,
|
||||||
NeedBuildAllFlag);
|
NeedBuildAllFlag,Note);
|
||||||
if (pcfOnlyIfNeeded in Flags) then begin
|
if (pcfOnlyIfNeeded in Flags) then begin
|
||||||
if Result=mrNo then begin
|
if Result=mrNo then begin
|
||||||
//DebugLn(['TLazPackageGraph.CompilePackage ',APackage.IDAsString,' does not need compilation.']);
|
//DebugLn(['TLazPackageGraph.CompilePackage ',APackage.IDAsString,' does not need compilation.']);
|
||||||
|
Loading…
Reference in New Issue
Block a user