mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:59:13 +02:00
IDEIntf: added IgnoreQuestions, compile package: ignore compile failures 24h, bug #16903
git-svn-id: trunk@26709 -
This commit is contained in:
parent
c7da8d084e
commit
d52620c7e3
@ -36,7 +36,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, FileProcs, DiffPatch, IDEProcs, AvgLvlTree,
|
Classes, SysUtils, FileUtil, FileProcs, DiffPatch, IDEProcs, AvgLvlTree,
|
||||||
SynEditTypes, Laz_XMLCfg, LazConf, Dialogs, LCLProc;
|
SynEditTypes, Laz_XMLCfg, LazConf, Dialogs, LCLProc, IDEDialogs;
|
||||||
|
|
||||||
{$ifdef Windows}
|
{$ifdef Windows}
|
||||||
{$define CaseInsensitiveFilenames}
|
{$define CaseInsensitiveFilenames}
|
||||||
@ -170,35 +170,21 @@ type
|
|||||||
TLazFindInFileSearchOptions = set of TLazFindInFileSearchOption;
|
TLazFindInFileSearchOptions = set of TLazFindInFileSearchOption;
|
||||||
|
|
||||||
|
|
||||||
{ TIHIngoreItem }
|
{ TIHIgnoreIDEQuestionList }
|
||||||
|
|
||||||
TIHIgnoreItemDuration = (
|
TIHIgnoreIDEQuestionList = class(TIgnoreIDEQuestionList)
|
||||||
iiidIDERestart,
|
|
||||||
iiid24H,
|
|
||||||
iiidForever
|
|
||||||
);
|
|
||||||
TIHIgnoreItemDurations = set of TIHIgnoreItemDuration;
|
|
||||||
|
|
||||||
TIHIngoreItem = class
|
|
||||||
Identifier: string;
|
|
||||||
Date: TDateTime;
|
|
||||||
Duration: TIHIgnoreItemDuration;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TIHIgnoreItemList }
|
|
||||||
|
|
||||||
TIHIgnoreItemList = class
|
|
||||||
private
|
private
|
||||||
FItems: TAvgLvlTree; // tree of TIHIngoreItem
|
FItems: TAvgLvlTree; // tree of TIgnoreIDEQuestionItem
|
||||||
function FindNode(const Identifier: string): TAvgLvlTreeNode;
|
function FindNode(const Identifier: string): TAvgLvlTreeNode;
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
function Add(const Identifier: string;
|
function Add(const Identifier: string;
|
||||||
Duration: TIHIgnoreItemDuration): TIHIngoreItem;
|
const Duration: TIgnoreQuestionDuration;
|
||||||
procedure Delete(const Identifier: string);
|
const Flag: string = ''): TIgnoreIDEQuestionItem; override;
|
||||||
function Find(const Identifier: string): TIHIngoreItem;
|
procedure Delete(const Identifier: string); override;
|
||||||
|
function Find(const Identifier: string): TIgnoreIDEQuestionItem; override;
|
||||||
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||||
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||||
end;
|
end;
|
||||||
@ -216,7 +202,7 @@ type
|
|||||||
FFindInFilesSearchOptions: TLazFindInFileSearchOptions;
|
FFindInFilesSearchOptions: TLazFindInFileSearchOptions;
|
||||||
FFindAutoComplete: boolean;
|
FFindAutoComplete: boolean;
|
||||||
FFindOptions: TSynSearchOptions;
|
FFindOptions: TSynSearchOptions;
|
||||||
FIgnores: TIHIgnoreItemList;
|
FIgnores: TIHIgnoreIDEQuestionList;
|
||||||
FLastConvertDelphiPackage: string;
|
FLastConvertDelphiPackage: string;
|
||||||
FLastConvertDelphiProject: string;
|
FLastConvertDelphiProject: string;
|
||||||
FLastConvertDelphiUnit: string;
|
FLastConvertDelphiUnit: string;
|
||||||
@ -321,7 +307,7 @@ type
|
|||||||
property FileEncodings: TStringToStringTree read fFileEncodings write fFileEncodings;
|
property FileEncodings: TStringToStringTree read fFileEncodings write fFileEncodings;
|
||||||
|
|
||||||
// ignores
|
// ignores
|
||||||
property Ignores: TIHIgnoreItemList read FIgnores;
|
property Ignores: TIHIgnoreIDEQuestionList read FIgnores;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -352,7 +338,7 @@ const
|
|||||||
'Replace',
|
'Replace',
|
||||||
'ReplaceAll'
|
'ReplaceAll'
|
||||||
);
|
);
|
||||||
IHIgnoreItemDurationNames: array[TIHIgnoreItemDuration] of string = (
|
IHIgnoreItemDurationNames: array[TIgnoreQuestionDuration] of string = (
|
||||||
'IDERestart',
|
'IDERestart',
|
||||||
'24H',
|
'24H',
|
||||||
'Forever'
|
'Forever'
|
||||||
@ -364,7 +350,7 @@ var
|
|||||||
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
||||||
function CompareAnsiStringWithIHIgnoreItem(AString, Item: Pointer): integer;
|
function CompareAnsiStringWithIHIgnoreItem(AString, Item: Pointer): integer;
|
||||||
|
|
||||||
function NameToIHIgnoreItemDuration(const s: string): TIHIgnoreItemDuration;
|
function NameToIHIgnoreItemDuration(const s: string): TIgnoreQuestionDuration;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -378,22 +364,22 @@ const
|
|||||||
|
|
||||||
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
||||||
var
|
var
|
||||||
IgnoreItem1: TIHIngoreItem absolute Item1;
|
IgnoreItem1: TIgnoreIDEQuestionItem absolute Item1;
|
||||||
IgnoreItem2: TIHIngoreItem absolute Item2;
|
IgnoreItem2: TIgnoreIDEQuestionItem absolute Item2;
|
||||||
begin
|
begin
|
||||||
Result:=SysUtils.CompareText(IgnoreItem1.Identifier,IgnoreItem2.Identifier);
|
Result:=SysUtils.CompareText(IgnoreItem1.Identifier,IgnoreItem2.Identifier);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CompareAnsiStringWithIHIgnoreItem(AString, Item: Pointer): integer;
|
function CompareAnsiStringWithIHIgnoreItem(AString, Item: Pointer): integer;
|
||||||
var
|
var
|
||||||
IgnoreItem: TIHIngoreItem absolute Item;
|
IgnoreItem: TIgnoreIDEQuestionItem absolute Item;
|
||||||
begin
|
begin
|
||||||
Result:=SysUtils.CompareText(AnsiString(AString),IgnoreItem.Identifier);
|
Result:=SysUtils.CompareText(AnsiString(AString),IgnoreItem.Identifier);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function NameToIHIgnoreItemDuration(const s: string): TIHIgnoreItemDuration;
|
function NameToIHIgnoreItemDuration(const s: string): TIgnoreQuestionDuration;
|
||||||
begin
|
begin
|
||||||
for Result:=low(TIHIgnoreItemDuration) to high(TIHIgnoreItemDuration) do
|
for Result:=low(TIgnoreQuestionDuration) to high(TIgnoreQuestionDuration) do
|
||||||
if SysUtils.CompareText(IHIgnoreItemDurationNames[Result],s)=0 then exit;
|
if SysUtils.CompareText(IHIgnoreItemDurationNames[Result],s)=0 then exit;
|
||||||
Result:=iiidIDERestart;
|
Result:=iiidIDERestart;
|
||||||
end;
|
end;
|
||||||
@ -435,13 +421,15 @@ begin
|
|||||||
|
|
||||||
fFileEncodings:=TStringToStringTree.Create({$IFDEF CaseInsensitiveFilenames}false{$ELSE}true{$ENDIF});
|
fFileEncodings:=TStringToStringTree.Create({$IFDEF CaseInsensitiveFilenames}false{$ELSE}true{$ENDIF});
|
||||||
|
|
||||||
FIgnores:=TIHIgnoreItemList.Create;
|
FIgnores:=TIHIgnoreIDEQuestionList.Create;
|
||||||
|
IgnoreQuestions:=FIgnores;
|
||||||
|
|
||||||
Clear;
|
Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TInputHistories.Destroy;
|
destructor TInputHistories.Destroy;
|
||||||
begin
|
begin
|
||||||
|
IgnoreQuestions:=nil;
|
||||||
FreeAndNil(FIgnores);
|
FreeAndNil(FIgnores);
|
||||||
FreeAndNil(FHistoryLists);
|
FreeAndNil(FHistoryLists);
|
||||||
FreeAndNil(FFileDialogSettings.HistoryList);
|
FreeAndNil(FFileDialogSettings.HistoryList);
|
||||||
@ -1083,48 +1071,48 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(Path+'UnitLinks/Value',UnitLinks,'');
|
XMLConfig.SetDeleteValue(Path+'UnitLinks/Value',UnitLinks,'');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TIHIgnoreItemList }
|
{ TIHIgnoreIDEQuestionList }
|
||||||
|
|
||||||
function TIHIgnoreItemList.FindNode(const Identifier: string): TAvgLvlTreeNode;
|
function TIHIgnoreIDEQuestionList.FindNode(const Identifier: string): TAvgLvlTreeNode;
|
||||||
begin
|
begin
|
||||||
Result:=FItems.FindKey(Pointer(Identifier),@CompareAnsiStringWithIHIgnoreItem);
|
Result:=FItems.FindKey(Pointer(Identifier),@CompareAnsiStringWithIHIgnoreItem);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TIHIgnoreItemList.Create;
|
constructor TIHIgnoreIDEQuestionList.Create;
|
||||||
begin
|
begin
|
||||||
FItems:=TAvgLvlTree.Create(@CompareIHIgnoreItems);
|
FItems:=TAvgLvlTree.Create(@CompareIHIgnoreItems);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TIHIgnoreItemList.Destroy;
|
destructor TIHIgnoreIDEQuestionList.Destroy;
|
||||||
begin
|
begin
|
||||||
FItems.FreeAndClear;
|
FItems.FreeAndClear;
|
||||||
FreeAndNil(FItems);
|
FreeAndNil(FItems);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIHIgnoreItemList.Clear;
|
procedure TIHIgnoreIDEQuestionList.Clear;
|
||||||
begin
|
begin
|
||||||
FItems.FreeAndClear;
|
FItems.FreeAndClear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIHIgnoreItemList.Add(const Identifier: string;
|
function TIHIgnoreIDEQuestionList.Add(const Identifier: string;
|
||||||
Duration: TIHIgnoreItemDuration): TIHIngoreItem;
|
const Duration: TIgnoreQuestionDuration; const Flag: string): TIgnoreIDEQuestionItem;
|
||||||
var
|
var
|
||||||
Node: TAvgLvlTreeNode;
|
Node: TAvgLvlTreeNode;
|
||||||
begin
|
begin
|
||||||
Node:=FindNode(Identifier);
|
Node:=FindNode(Identifier);
|
||||||
if Node<>nil then begin
|
if Node<>nil then begin
|
||||||
Result:=TIHIngoreItem(Node.Data);
|
Result:=TIgnoreIDEQuestionItem(Node.Data);
|
||||||
end else begin
|
end else begin
|
||||||
Result:=TIHIngoreItem.Create;
|
Result:=TIgnoreIDEQuestionItem.Create(Identifier);
|
||||||
Result.Identifier:=Identifier;
|
|
||||||
FItems.Add(Result);
|
FItems.Add(Result);
|
||||||
end;
|
end;
|
||||||
Result.Duration:=Duration;
|
Result.Duration:=Duration;
|
||||||
Result.Date:=Now;
|
Result.Date:=Now;
|
||||||
|
Result.Flag:=Flag;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIHIgnoreItemList.Delete(const Identifier: string);
|
procedure TIHIgnoreIDEQuestionList.Delete(const Identifier: string);
|
||||||
var
|
var
|
||||||
Node: TAvgLvlTreeNode;
|
Node: TAvgLvlTreeNode;
|
||||||
begin
|
begin
|
||||||
@ -1133,18 +1121,18 @@ begin
|
|||||||
FItems.FreeAndDelete(Node);
|
FItems.FreeAndDelete(Node);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIHIgnoreItemList.Find(const Identifier: string): TIHIngoreItem;
|
function TIHIgnoreIDEQuestionList.Find(const Identifier: string): TIgnoreIDEQuestionItem;
|
||||||
var
|
var
|
||||||
Node: TAvgLvlTreeNode;
|
Node: TAvgLvlTreeNode;
|
||||||
begin
|
begin
|
||||||
Node:=FindNode(Identifier);
|
Node:=FindNode(Identifier);
|
||||||
if Node<>nil then
|
if Node<>nil then
|
||||||
Result:=TIHIngoreItem(Node.Data)
|
Result:=TIgnoreIDEQuestionItem(Node.Data)
|
||||||
else
|
else
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIHIgnoreItemList.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
procedure TIHIgnoreIDEQuestionList.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
||||||
const Path: string);
|
const Path: string);
|
||||||
var
|
var
|
||||||
Cnt: longint;
|
Cnt: longint;
|
||||||
@ -1152,35 +1140,44 @@ var
|
|||||||
SubPath: String;
|
SubPath: String;
|
||||||
Identifier: String;
|
Identifier: String;
|
||||||
ADate: TDateTime;
|
ADate: TDateTime;
|
||||||
ADuration: TIHIgnoreItemDuration;
|
ADuration: TIgnoreQuestionDuration;
|
||||||
Item: TIHIngoreItem;
|
Item: TIgnoreIDEQuestionItem;
|
||||||
|
CurNow: TDateTime;
|
||||||
begin
|
begin
|
||||||
Clear;
|
Clear;
|
||||||
|
CurNow:=Now;
|
||||||
Cnt:=XMLConfig.GetValue(Path+'Count',0);
|
Cnt:=XMLConfig.GetValue(Path+'Count',0);
|
||||||
for i:=1 to Cnt do begin
|
for i:=1 to Cnt do begin
|
||||||
SubPath:=Path+'Item'+IntToStr(i)+'/';
|
SubPath:=Path+'Item'+IntToStr(i)+'/';
|
||||||
Identifier:=XMLConfig.GetValue(SubPath+'Name','');
|
Identifier:=XMLConfig.GetValue(SubPath+'Name','');
|
||||||
if Identifier='' then continue;
|
if Identifier='' then continue;
|
||||||
if not CfgStrToDate(XMLConfig.GetValue(SubPath+'Date',''),ADate) then continue;
|
if not CfgStrToDate(XMLConfig.GetValue(SubPath+'Date',''),ADate) then continue;
|
||||||
ADuration:=NameToIHIgnoreItemDuration(XMLConfig.GetValue(SubPath+'Duration',''));
|
ADuration:=NameToIHIgnoreItemDuration(XMLConfig.GetValue(SubPath+'Duration',
|
||||||
if ADuration=iiidIDERestart then continue;
|
IHIgnoreItemDurationNames[iiid24H]));
|
||||||
|
//debugln(['TIHIgnoreIDEQuestionList.LoadFromXMLConfig Identifier="',Identifier,'" Date=',DateTimeToStr(ADate),' Diff=',DateTimeToStr(CurNow-ADate),' Duration=',IHIgnoreItemDurationNames[ADuration]]);
|
||||||
|
case ADuration of
|
||||||
|
iiidIDERestart: continue;
|
||||||
|
iiid24H: if Abs(CurNow-ADate)>1 then continue;
|
||||||
|
iiidForever: ;
|
||||||
|
end;
|
||||||
Item:=Add(Identifier,ADuration);
|
Item:=Add(Identifier,ADuration);
|
||||||
Item.Date:=ADate;
|
Item.Date:=ADate;
|
||||||
|
Item.Flag:=XMLConfig.GetValue(SubPath+'Flag','');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIHIgnoreItemList.SaveToXMLConfig(XMLConfig: TXMLConfig;
|
procedure TIHIgnoreIDEQuestionList.SaveToXMLConfig(XMLConfig: TXMLConfig;
|
||||||
const Path: string);
|
const Path: string);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
Node: TAvgLvlTreeNode;
|
Node: TAvgLvlTreeNode;
|
||||||
Item: TIHIngoreItem;
|
Item: TIgnoreIDEQuestionItem;
|
||||||
SubPath: String;
|
SubPath: String;
|
||||||
begin
|
begin
|
||||||
i:=0;
|
i:=0;
|
||||||
Node:=FItems.FindLowest;
|
Node:=FItems.FindLowest;
|
||||||
while Node<>nil do begin
|
while Node<>nil do begin
|
||||||
Item:=TIHIngoreItem(Node.Data);
|
Item:=TIgnoreIDEQuestionItem(Node.Data);
|
||||||
if (Item.Duration<>iiidIDERestart) and (Item.Identifier<>'') then begin
|
if (Item.Duration<>iiidIDERestart) and (Item.Identifier<>'') then begin
|
||||||
inc(i);
|
inc(i);
|
||||||
SubPath:=Path+'Item'+IntToStr(i)+'/';
|
SubPath:=Path+'Item'+IntToStr(i)+'/';
|
||||||
@ -1189,6 +1186,7 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(SubPath+'Duration',
|
XMLConfig.SetDeleteValue(SubPath+'Duration',
|
||||||
IHIgnoreItemDurationNames[Item.Duration],
|
IHIgnoreItemDurationNames[Item.Duration],
|
||||||
IHIgnoreItemDurationNames[iiid24H]);
|
IHIgnoreItemDurationNames[iiid24H]);
|
||||||
|
XMLConfig.SetDeleteValue(SubPath+'Flag',Item.Flag,'');
|
||||||
end;
|
end;
|
||||||
Node:=FItems.FindSuccessor(Node);
|
Node:=FItems.FindSuccessor(Node);
|
||||||
end;
|
end;
|
||||||
|
@ -52,6 +52,40 @@ function IDEQuestionDialogAb(const aCaption, aMsg: string;
|
|||||||
DlgType: TMsgDlgType; Buttons: array of const;
|
DlgType: TMsgDlgType; Buttons: array of const;
|
||||||
HideAbort: boolean; const HelpKeyword: string = ''): Integer;
|
HideAbort: boolean; const HelpKeyword: string = ''): Integer;
|
||||||
|
|
||||||
|
type
|
||||||
|
{ TIgnoreIDEQuestionItem }
|
||||||
|
|
||||||
|
TIgnoreQuestionDuration = (
|
||||||
|
iiidIDERestart,
|
||||||
|
iiid24H,
|
||||||
|
iiidForever
|
||||||
|
);
|
||||||
|
TIgnoreQuestionDurations = set of TIgnoreQuestionDuration;
|
||||||
|
|
||||||
|
TIgnoreIDEQuestionItem = class
|
||||||
|
private
|
||||||
|
FIdentifier: string;
|
||||||
|
public
|
||||||
|
Date: TDateTime;
|
||||||
|
Flag: string;
|
||||||
|
Duration: TIgnoreQuestionDuration;
|
||||||
|
constructor Create(const TheIdentifier: string);
|
||||||
|
property Identifier: string read FIdentifier;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TIgnoreIDEQuestionList }
|
||||||
|
|
||||||
|
TIgnoreIDEQuestionList = class
|
||||||
|
public
|
||||||
|
function Add(const Identifier: string;
|
||||||
|
const Duration: TIgnoreQuestionDuration;
|
||||||
|
const Flag: string = ''): TIgnoreIDEQuestionItem; virtual; abstract;
|
||||||
|
procedure Delete(const Identifier: string); virtual; abstract;
|
||||||
|
function Find(const Identifier: string): TIgnoreIDEQuestionItem; virtual; abstract;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
IgnoreQuestions: TIgnoreIDEQuestionList = nil;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -105,5 +139,13 @@ begin
|
|||||||
Result:=IDEQuestionDialog(aCaption,aMsg,DlgType,NewButtons,HelpKeyword);
|
Result:=IDEQuestionDialog(aCaption,aMsg,DlgType,NewButtons,HelpKeyword);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TIgnoreIDEQuestionItem }
|
||||||
|
|
||||||
|
constructor TIgnoreIDEQuestionItem.Create(const TheIdentifier: string);
|
||||||
|
begin
|
||||||
|
fIdentifier:=TheIdentifier;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -268,9 +268,9 @@ type
|
|||||||
RenameDependencies: boolean);
|
RenameDependencies: boolean);
|
||||||
function SavePackageCompiledState(APackage: TLazPackage;
|
function SavePackageCompiledState(APackage: TLazPackage;
|
||||||
const CompilerFilename, CompilerParams: string;
|
const CompilerFilename, CompilerParams: string;
|
||||||
Complete: boolean): TModalResult;
|
Complete, ShowAbort: boolean): TModalResult;
|
||||||
function LoadPackageCompiledState(APackage: TLazPackage;
|
function LoadPackageCompiledState(APackage: TLazPackage;
|
||||||
IgnoreErrors: boolean): TModalResult;
|
IgnoreErrors, ShowAbort: boolean): TModalResult;
|
||||||
function CheckCompileNeedDueToDependencies(FirstDependency: TPkgDependency;
|
function CheckCompileNeedDueToDependencies(FirstDependency: TPkgDependency;
|
||||||
StateFileAge: longint): TModalResult;
|
StateFileAge: longint): TModalResult;
|
||||||
function ExtractCompilerParamsForBuildAll(const CompParams: string): string;
|
function ExtractCompilerParamsForBuildAll(const CompParams: string): string;
|
||||||
@ -2702,7 +2702,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.SavePackageCompiledState(APackage: TLazPackage;
|
function TLazPackageGraph.SavePackageCompiledState(APackage: TLazPackage;
|
||||||
const CompilerFilename, CompilerParams: string; Complete: boolean
|
const CompilerFilename, CompilerParams: string; Complete, ShowAbort: boolean
|
||||||
): TModalResult;
|
): TModalResult;
|
||||||
var
|
var
|
||||||
XMLConfig: TXMLConfig;
|
XMLConfig: TXMLConfig;
|
||||||
@ -2735,10 +2735,10 @@ begin
|
|||||||
APackage.Flags:=APackage.Flags+[lpfStateFileLoaded];
|
APackage.Flags:=APackage.Flags+[lpfStateFileLoaded];
|
||||||
except
|
except
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
Result:=IDEMessageDialog(lisPkgMangErrorWritingFile,
|
Result:=IDEMessageDialogAb(lisPkgMangErrorWritingFile,
|
||||||
Format(lisPkgMangUnableToWriteStateFileOfPackageError, ['"', StateFile,
|
Format(lisPkgMangUnableToWriteStateFileOfPackageError, ['"', StateFile,
|
||||||
'"', #13, APackage.IDAsString, #13, E.Message]),
|
'"', #13, APackage.IDAsString, #13, E.Message]),
|
||||||
mtError,[mbAbort,mbCancel]);
|
mtError,[mbCancel],ShowAbort);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2747,7 +2747,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.LoadPackageCompiledState(APackage: TLazPackage;
|
function TLazPackageGraph.LoadPackageCompiledState(APackage: TLazPackage;
|
||||||
IgnoreErrors: boolean): TModalResult;
|
IgnoreErrors, ShowAbort: boolean): TModalResult;
|
||||||
var
|
var
|
||||||
XMLConfig: TXMLConfig;
|
XMLConfig: TXMLConfig;
|
||||||
StateFile: String;
|
StateFile: String;
|
||||||
@ -2784,10 +2784,10 @@ begin
|
|||||||
if IgnoreErrors then begin
|
if IgnoreErrors then begin
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end else begin
|
end else begin
|
||||||
Result:=IDEMessageDialog(lisPkgMangErrorReadingFile,
|
Result:=IDEMessageDialogAb(lisPkgMangErrorReadingFile,
|
||||||
Format(lisPkgMangUnableToReadStateFileOfPackageError, ['"',
|
Format(lisPkgMangUnableToReadStateFileOfPackageError, ['"',
|
||||||
StateFile, '"', #13, APackage.IDAsString, #13, E.Message]),
|
StateFile, '"', #13, APackage.IDAsString, #13, E.Message]),
|
||||||
mtError,[mbCancel,mbAbort]);
|
mtError,[mbCancel],ShowAbort);
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -2822,7 +2822,7 @@ begin
|
|||||||
RequiredPackage:=Dependency.RequiredPackage;
|
RequiredPackage:=Dependency.RequiredPackage;
|
||||||
// check compile state file of required package
|
// check compile state file of required package
|
||||||
if not RequiredPackage.AutoCreated then begin
|
if not RequiredPackage.AutoCreated then begin
|
||||||
Result:=LoadPackageCompiledState(RequiredPackage,false);
|
Result:=LoadPackageCompiledState(RequiredPackage,false,true);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
Result:=mrYes;
|
Result:=mrYes;
|
||||||
if not (lpfStateFileLoaded in RequiredPackage.Flags) then begin
|
if not (lpfStateFileLoaded in RequiredPackage.Flags) then begin
|
||||||
@ -2937,7 +2937,7 @@ begin
|
|||||||
|
|
||||||
// check state file
|
// check state file
|
||||||
StateFilename:=APackage.GetStateFilename;
|
StateFilename:=APackage.GetStateFilename;
|
||||||
Result:=LoadPackageCompiledState(APackage,false);
|
Result:=LoadPackageCompiledState(APackage,false,true);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
if not (lpfStateFileLoaded in APackage.Flags) then begin
|
if not (lpfStateFileLoaded in APackage.Flags) then begin
|
||||||
DebugLn('TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for ',APackage.IDAsString);
|
DebugLn('TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for ',APackage.IDAsString);
|
||||||
@ -3051,6 +3051,12 @@ end;
|
|||||||
function TLazPackageGraph.CompilePackage(APackage: TLazPackage;
|
function TLazPackageGraph.CompilePackage(APackage: TLazPackage;
|
||||||
Flags: TPkgCompileFlags; ShowAbort: boolean; Globals: TGlobalCompilerOptions
|
Flags: TPkgCompileFlags; ShowAbort: boolean; Globals: TGlobalCompilerOptions
|
||||||
): TModalResult;
|
): TModalResult;
|
||||||
|
|
||||||
|
function GetIgnoreIdentifier: string;
|
||||||
|
begin
|
||||||
|
Result:='install_package_compile_failed:'+APackage.Filename;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
PkgCompileTool: TIDEExternalToolOptions;
|
PkgCompileTool: TIDEExternalToolOptions;
|
||||||
CompilerFilename: String;
|
CompilerFilename: String;
|
||||||
@ -3060,7 +3066,7 @@ var
|
|||||||
CompilePolicies: TPackageUpdatePolicies;
|
CompilePolicies: TPackageUpdatePolicies;
|
||||||
BlockBegan: Boolean;
|
BlockBegan: Boolean;
|
||||||
NeedBuildAllFlag: Boolean;
|
NeedBuildAllFlag: Boolean;
|
||||||
CompileResult: TModalResult;
|
CompileResult, MsgResult: TModalResult;
|
||||||
begin
|
begin
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
|
|
||||||
@ -3207,7 +3213,7 @@ begin
|
|||||||
// write state file
|
// write state file
|
||||||
Result:=SavePackageCompiledState(APackage,
|
Result:=SavePackageCompiledState(APackage,
|
||||||
CompilerFilename,CompilerParams,
|
CompilerFilename,CompilerParams,
|
||||||
CompileResult=mrOk);
|
CompileResult=mrOk,true);
|
||||||
if Result<>mrOk then begin
|
if Result<>mrOk then begin
|
||||||
DebugLn(['TLazPackageGraph.CompilePackage SavePackageCompiledState failed: ',APackage.IDAsString]);
|
DebugLn(['TLazPackageGraph.CompilePackage SavePackageCompiledState failed: ',APackage.IDAsString]);
|
||||||
exit;
|
exit;
|
||||||
@ -3247,15 +3253,21 @@ begin
|
|||||||
if BlockBegan and (IDEMessagesWindow<>nil) then
|
if BlockBegan and (IDEMessagesWindow<>nil) then
|
||||||
IDEMessagesWindow.EndBlock;
|
IDEMessagesWindow.EndBlock;
|
||||||
if Result<>mrOk then begin
|
if Result<>mrOk then begin
|
||||||
if (APackage.AutoInstall<>pitNope) and (APackage.Installed=pitNope)
|
if (APackage.AutoInstall<>pitNope)
|
||||||
and (OnUninstallPackage<>nil) then begin
|
and (OnUninstallPackage<>nil)
|
||||||
// package was tried to install, but failed
|
and (IgnoreQuestions<>nil)
|
||||||
|
and (IgnoreQuestions.Find(GetIgnoreIdentifier)=nil)
|
||||||
|
then begin
|
||||||
|
// a package needed for installation failed to compile
|
||||||
// -> ask user if the package should be removed from the installation
|
// -> ask user if the package should be removed from the installation
|
||||||
// list
|
// list
|
||||||
if IDEMessageDialog(lisInstallationFailed,
|
MsgResult:=IDEMessageDialog(lisInstallationFailed,
|
||||||
Format(lisPkgMangThePackageFailedToCompileRemoveItFromTheInstallati,
|
Format(lisPkgMangThePackageFailedToCompileRemoveItFromTheInstallati,
|
||||||
['"', APackage.IDAsString, '"', #13]), mtConfirmation,
|
['"', APackage.IDAsString, '"', #13]), mtConfirmation,
|
||||||
[mbYes,mbIgnore])=mrYes then
|
[mbYes,mbIgnore]);
|
||||||
|
if MsgResult=mrIgnore then
|
||||||
|
IgnoreQuestions.Add(GetIgnoreIdentifier,iiid24H)
|
||||||
|
else if MsgResult=mrYes then
|
||||||
begin
|
begin
|
||||||
Result:=OnUninstallPackage(APackage,
|
Result:=OnUninstallPackage(APackage,
|
||||||
[puifDoNotConfirm,puifDoNotBuildIDE],true);
|
[puifDoNotConfirm,puifDoNotBuildIDE],true);
|
||||||
|
Loading…
Reference in New Issue
Block a user