mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 02:59:15 +02:00
IDE: build modes: assign/load/save/creatediff
git-svn-id: trunk@17989 -
This commit is contained in:
parent
d8c89b30e2
commit
9e3a20fbaa
@ -64,6 +64,8 @@ type
|
||||
procedure Assign(Source: TLazBuildMode); override;
|
||||
procedure LoadFromXMLConfig(AXMLConfig: TXMLConfig; const Path: string; DoSwitchPathDelims: boolean);
|
||||
procedure SaveToXMLConfig(AXMLConfig: TXMLConfig; const Path: string);
|
||||
procedure CreateDiff(OtherMode: TLazBuildMode; Tool: TCompilerDiffTool);
|
||||
procedure Assign(Source: TIDEBuildMode);
|
||||
end;
|
||||
|
||||
{ TIDEBuildModes }
|
||||
@ -84,6 +86,8 @@ type
|
||||
procedure Move(OldIndex, NewIndex: integer); override;
|
||||
procedure LoadFromXMLConfig(AXMLConfig: TXMLConfig; const Path: string; DoSwitchPathDelims: boolean);
|
||||
procedure SaveToXMLConfig(AXMLConfig: TXMLConfig; const Path: string);
|
||||
procedure CreateDiff(OtherModes: TLazBuildModes; Tool: TCompilerDiffTool);
|
||||
procedure Assign(Source: TLazBuildModes);
|
||||
end;
|
||||
|
||||
{ TBuildModeSet }
|
||||
@ -2578,8 +2582,9 @@ begin
|
||||
DebugPath := CompOpts.DebugPath;
|
||||
|
||||
// conditionals
|
||||
fLCLWidgetType := CompOpts.fLCLWidgetType;
|
||||
Conditionals.Assign(CompOpts.Conditionals);
|
||||
TIDEBuildModes(BuildModes).Assign(CompOpts.BuildModes);
|
||||
fLCLWidgetType := CompOpts.fLCLWidgetType;
|
||||
|
||||
// Parsing
|
||||
FSyntaxMode := CompOpts.FSyntaxMode;
|
||||
@ -2702,6 +2707,7 @@ begin
|
||||
|
||||
// conditionals
|
||||
TCompOptConditionals(Conditionals).CreateDiff(CompOpts.Conditionals,Tool);
|
||||
TIDEBuildModes(fBuildModes).CreateDiff(CompOpts.BuildModes,Tool);
|
||||
Tool.AddDiff('LCLWidgetType',fLCLWidgetType,CompOpts.fLCLWidgetType);
|
||||
|
||||
// parsing
|
||||
@ -3298,17 +3304,34 @@ procedure TIDEBuildMode.LoadFromXMLConfig(AXMLConfig: TXMLConfig;
|
||||
const Path: string; DoSwitchPathDelims: boolean);
|
||||
begin
|
||||
FIdentifier:=AXMLConfig.GetValue(Path+'Identifier/Value','');
|
||||
LoadStringList(AXMLConfig,FValues,Path+'Values/');
|
||||
TCompOptConditionals(FDefaultValue).LoadFromXMLConfig(AXMLConfig,Path+'DefaultValue',
|
||||
DoSwitchPathDelims);
|
||||
LoadStringList(AXMLConfig,FValues,Path+'Values/');
|
||||
end;
|
||||
|
||||
procedure TIDEBuildMode.SaveToXMLConfig(AXMLConfig: TXMLConfig;
|
||||
const Path: string);
|
||||
begin
|
||||
AXMLConfig.SetDeleteValue(Path+'Identifier/Value',FIdentifier,'');
|
||||
TCompOptConditionals(FDefaultValue).SaveToXMLConfig(AXMLConfig,Path+'DefaultValue');
|
||||
SaveStringList(AXMLConfig,FValues,Path+'Values/');
|
||||
TCompOptConditionals(FDefaultValue).SaveToXMLConfig(AXMLConfig,Path+'DefaultValue');
|
||||
end;
|
||||
|
||||
procedure TIDEBuildMode.CreateDiff(OtherMode: TLazBuildMode;
|
||||
Tool: TCompilerDiffTool);
|
||||
begin
|
||||
Tool.AddDiff('Identifier',Identifier,OtherMode.Identifier);
|
||||
Tool.AddStringsDiff('Values',Values,OtherMode.Values);
|
||||
TCompOptConditionals(DefaultValue).CreateDiff(OtherMode.DefaultValue,Tool);
|
||||
end;
|
||||
|
||||
procedure TIDEBuildMode.Assign(Source: TIDEBuildMode);
|
||||
begin
|
||||
Identifier:=Source.Identifier;
|
||||
Values:=Source.Values;
|
||||
DefaultValue.Assign(Source.DefaultValue);
|
||||
LocalizedName:=Source.LocalizedName;
|
||||
LocalizedValues:=Source.LocalizedValues;
|
||||
end;
|
||||
|
||||
{ TIDEBuildModes }
|
||||
@ -3409,6 +3432,30 @@ begin
|
||||
TIDEBuildMode(Items[i]).SaveToXMLConfig(AXMLConfig,Path+'Item'+IntToStr(i+1)+'/');
|
||||
end;
|
||||
|
||||
procedure TIDEBuildModes.CreateDiff(OtherModes: TLazBuildModes;
|
||||
Tool: TCompilerDiffTool);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
Tool.AddDiff('Count',Count,OtherModes.Count);
|
||||
for i:=0 to Count-1 do begin
|
||||
if i<OtherModes.Count then
|
||||
TIDEBuildMode(Items[i]).CreateDiff(OtherModes.Items[i],Tool);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIDEBuildModes.Assign(Source: TLazBuildModes);
|
||||
var
|
||||
i: Integer;
|
||||
Item: TLazBuildMode;
|
||||
begin
|
||||
Clear;
|
||||
for i:=0 to Source.Count-1 do begin
|
||||
Item:=Add(Source[i].Identifier);
|
||||
TIDEBuildMode(Item).Assign(Source[i]);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
CompilerParseStamp:=1;
|
||||
CompilerParseStampIncreased:=nil;
|
||||
|
@ -60,6 +60,7 @@ type
|
||||
procedure AddDiff(const PropertyName: string; const Old, New: string);
|
||||
procedure AddDiff(const PropertyName: string; const Old, New: integer);
|
||||
procedure AddDiff(const PropertyName: string; const Old, New: boolean);
|
||||
procedure AddStringsDiff(const PropertyName: string; const OldList, NewList: TStrings);
|
||||
procedure AddPathsDiff(const PropertyName: string; const Old, New: string);
|
||||
procedure AddSetDiff(const PropertyName: string; const Old, New: integer;
|
||||
const EnumNames: PString);
|
||||
@ -436,6 +437,18 @@ begin
|
||||
AddDiffItem(PropertyName,dbgs(New));
|
||||
end;
|
||||
|
||||
procedure TCompilerDiffTool.AddStringsDiff(const PropertyName: string;
|
||||
const OldList, NewList: TStrings);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
AddDiff(PropertyName+'/Count',OldList.Count,NewList.Count);
|
||||
for i:=0 to OldList.Count-1 do begin
|
||||
if (i>=NewList.Count) or (OldList[i]<>NewList[i]) then
|
||||
AddDiffItem(PropertyName+'/Item'+IntToStr(i),NewList[i]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCompilerDiffTool.AddPathsDiff(const PropertyName: string; const Old,
|
||||
New: string);
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user