mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 15:52:49 +02:00
IDE: build modes: add standard build mode
git-svn-id: trunk@18788 -
This commit is contained in:
parent
4b6abe2cbe
commit
a4e0c566a7
@ -206,6 +206,7 @@ begin
|
||||
OnBackupFileInteractive:=@BackupFile;
|
||||
RunCompilerWithOptions:=@OnRunCompilerWithOptions;
|
||||
GlobalBuildModeSet:=TBuildModeSet.Create;
|
||||
GlobalBuildModeSet.AddStandardModes;
|
||||
end;
|
||||
|
||||
destructor TBuildManager.Destroy;
|
||||
|
@ -68,6 +68,7 @@ type
|
||||
UsePathDelim: TPathDelimSwitch);
|
||||
procedure CreateDiff(OtherMode: TLazBuildMode; Tool: TCompilerDiffTool);
|
||||
procedure Assign(Source: TIDEBuildMode);
|
||||
procedure SetDefaultValue(const AValue: string); override;
|
||||
end;
|
||||
|
||||
TBuildModeSet = class;
|
||||
@ -86,7 +87,7 @@ type
|
||||
function Add(Identifier: string): TLazBuildMode; override;
|
||||
procedure Clear; override;
|
||||
function Count: integer; override;
|
||||
constructor Create;
|
||||
constructor Create(TheOwner: TObject); override;
|
||||
procedure Delete(Index: integer); override;
|
||||
destructor Destroy; override;
|
||||
function IndexOfIdentifier(Identifier: string): integer; override;
|
||||
@ -114,6 +115,7 @@ type
|
||||
function FindModeWithIdentifier(Identifier: string; out BuildModes: TIDEBuildModes;
|
||||
out BuildMode: TIDEBuildMode): boolean;
|
||||
function GetUniqueModeName(CheckToo: TIDEBuildModes): string;
|
||||
procedure AddStandardModes;
|
||||
property Evaluator: TExpressionEvaluator read FEvaluator;
|
||||
end;
|
||||
|
||||
@ -850,7 +852,7 @@ begin
|
||||
FParsedOpts := TParsedCompilerOptions.Create(TCompOptConditionals(FConditionals));
|
||||
FExecuteBefore := AToolClass.Create;
|
||||
FExecuteAfter := AToolClass.Create;
|
||||
fBuildModes := TIDEBuildModes.Create;
|
||||
fBuildModes := TIDEBuildModes.Create(Self);
|
||||
|
||||
Clear;
|
||||
end;
|
||||
@ -3296,7 +3298,17 @@ begin
|
||||
end;
|
||||
|
||||
destructor TBuildModeSet.Destroy;
|
||||
var
|
||||
BuildMode: TIDEBuildModes;
|
||||
NextMode: TIDEBuildModes;
|
||||
begin
|
||||
BuildMode:=FFirstBuildModes;
|
||||
while BuildMode<>nil do begin
|
||||
NextMode:=BuildMode.fNextModes;
|
||||
if BuildMode.Owner=Self then
|
||||
BuildMode.Free;
|
||||
BuildMode:=NextMode;
|
||||
end;
|
||||
FreeAndNil(FEvaluator);
|
||||
inherited Destroy;
|
||||
end;
|
||||
@ -3328,6 +3340,25 @@ begin
|
||||
and ((CheckToo=nil) or (CheckToo.IndexOfIdentifier(Result)<0));
|
||||
end;
|
||||
|
||||
procedure TBuildModeSet.AddStandardModes;
|
||||
var
|
||||
StdModes: TIDEBuildModes;
|
||||
MainMode: TLazBuildMode;
|
||||
begin
|
||||
StdModes:=TIDEBuildModes.Create(Self);
|
||||
MainMode:=StdModes.Add('BuildMode');
|
||||
MainMode.Description:='Main build mode';
|
||||
MainMode.Values.Text:='Default'+LineEnding
|
||||
+'Debug'+LineEnding
|
||||
+'Release'+LineEnding
|
||||
+'Mode1'+LineEnding
|
||||
+'Mode2'+LineEnding
|
||||
+'Mode3'+LineEnding
|
||||
+'Mode4'+LineEnding;
|
||||
MainMode.SetDefaultValue('Default');
|
||||
StdModes.BuildModeSet:=Self;
|
||||
end;
|
||||
|
||||
{ TIDEBuildMode }
|
||||
|
||||
procedure TIDEBuildMode.SetIdentifier(const AValue: string);
|
||||
@ -3429,6 +3460,18 @@ begin
|
||||
ValueDescriptions:=Source.ValueDescriptions;
|
||||
end;
|
||||
|
||||
procedure TIDEBuildMode.SetDefaultValue(const AValue: string);
|
||||
var
|
||||
Node: TCompOptCondNode;
|
||||
begin
|
||||
DefaultValue.Root.ClearNodes;
|
||||
Node:=TCompOptCondNode.Create(DefaultValue);
|
||||
Node.NodeType:=cocntSetValue;
|
||||
Node.ValueType:=cocvtResult;
|
||||
Node.Value:=AValue;
|
||||
DefaultValue.Root.AddLast(Node);
|
||||
end;
|
||||
|
||||
{ TIDEBuildModes }
|
||||
|
||||
procedure TIDEBuildModes.SetBuildModeSet(const AValue: TBuildModeSet);
|
||||
@ -3480,8 +3523,9 @@ begin
|
||||
Result:=FItems.Count;
|
||||
end;
|
||||
|
||||
constructor TIDEBuildModes.Create;
|
||||
constructor TIDEBuildModes.Create(TheOwner: TObject);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
FItems:=TFPList.Create;
|
||||
end;
|
||||
|
||||
|
@ -167,6 +167,7 @@ type
|
||||
procedure SetValues(const AValue: TStrings); virtual; abstract;
|
||||
public
|
||||
procedure Assign(Source: TLazBuildMode); virtual; abstract;
|
||||
procedure SetDefaultValue(const AValue: string); virtual; abstract;
|
||||
property Identifier: string read FIdentifier write SetIdentifier;
|
||||
property Description: string read FDescription write SetDescription;
|
||||
property Values: TStrings read FValues write SetValues;
|
||||
@ -177,9 +178,12 @@ type
|
||||
{ TLazBuildModes }
|
||||
|
||||
TLazBuildModes = class
|
||||
private
|
||||
FOwner: TObject;
|
||||
protected
|
||||
function GetItems(Index: integer): TLazBuildMode; virtual; abstract;
|
||||
public
|
||||
constructor Create(TheOwner: TObject); virtual;
|
||||
function Add(Identifier: string): TLazBuildMode; virtual; abstract;
|
||||
procedure Delete(Index: integer); virtual; abstract;
|
||||
procedure Move(OldIndex, NewIndex: integer); virtual; abstract;
|
||||
@ -188,6 +192,7 @@ type
|
||||
function Count: integer; virtual; abstract;
|
||||
procedure Clear; virtual; abstract;
|
||||
property Items[Index: integer]: TLazBuildMode read GetItems; default;
|
||||
property Owner: TObject read FOwner;
|
||||
end;
|
||||
|
||||
{ TLazCompilerOptions }
|
||||
@ -1621,6 +1626,13 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
{ TLazBuildModes }
|
||||
|
||||
constructor TLazBuildModes.Create(TheOwner: TObject);
|
||||
begin
|
||||
FOwner:=TheOwner
|
||||
end;
|
||||
|
||||
initialization
|
||||
ProjectFileDescriptors:=nil;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user