mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 20:51:11 +01:00
IDE: configure build Lazarus dialog: made clean once an option
git-svn-id: trunk@36307 -
This commit is contained in:
parent
a083dd405b
commit
0d5fbc6330
@ -1,7 +1,7 @@
|
||||
object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
|
||||
Left = 354
|
||||
Left = 349
|
||||
Height = 480
|
||||
Top = 78
|
||||
Top = 200
|
||||
Width = 700
|
||||
VertScrollBar.Visible = False
|
||||
BorderIcons = [biSystemMenu]
|
||||
@ -232,14 +232,14 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
|
||||
ParentColor = False
|
||||
end
|
||||
object UpdateRevisionIncCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = CleanUpRadioGroup
|
||||
AnchorSideTop.Control = CleanUpRadioGroup
|
||||
AnchorSideLeft.Control = CleanUpGroupBox
|
||||
AnchorSideTop.Control = CleanUpGroupBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 340
|
||||
Height = 22
|
||||
Hint = 'Increment revision? (ToDo: get a better hint)'
|
||||
Top = 245
|
||||
Top = 336
|
||||
Width = 181
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'UpdateRevisionIncCheckBox'
|
||||
@ -361,23 +361,23 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
|
||||
ItemHeight = 0
|
||||
TabOrder = 7
|
||||
end
|
||||
object CleanUpRadioGroup: TRadioGroup
|
||||
object CleanUpGroupBox: TGroupBox
|
||||
AnchorSideLeft.Control = DefinesListBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = DefinesListBox
|
||||
AnchorSideTop.Control = TargetDirectoryComboBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = DetailsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 340
|
||||
Height = 4
|
||||
Top = 235
|
||||
Height = 116
|
||||
Top = 214
|
||||
Width = 353
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoFill = True
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
Caption = 'Building IDE'
|
||||
Caption = 'Clean up'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ChildSizing.TopBottomSpacing = 6
|
||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||
@ -386,9 +386,44 @@ object ConfigureBuildLazarusDlg: TConfigureBuildLazarusDlg
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 1
|
||||
ClientHeight = 100
|
||||
ClientWidth = 349
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 13
|
||||
object CleanAutoRadioButton: TRadioButton
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 6
|
||||
Width = 337
|
||||
Caption = 'CleanAutoRadioButton'
|
||||
Checked = True
|
||||
TabOrder = 0
|
||||
end
|
||||
object CleanCommonRadioButton: TRadioButton
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 28
|
||||
Width = 337
|
||||
Caption = 'CleanCommonRadioButton'
|
||||
TabOrder = 1
|
||||
end
|
||||
object CleanAllRadioButton: TRadioButton
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 50
|
||||
Width = 337
|
||||
Caption = 'CleanAllRadioButton'
|
||||
TabOrder = 2
|
||||
end
|
||||
object CleanOnceCheckBox: TCheckBox
|
||||
Left = 6
|
||||
Height = 22
|
||||
Top = 72
|
||||
Width = 337
|
||||
Caption = 'CleanOnceCheckBox'
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
end
|
||||
object CBLDBtnPanel: TPanel
|
||||
|
||||
@ -73,6 +73,10 @@ type
|
||||
{ TConfigureBuildLazarusDlg }
|
||||
|
||||
TConfigureBuildLazarusDlg = class(TForm)
|
||||
CleanAllRadioButton: TRadioButton;
|
||||
CleanAutoRadioButton: TRadioButton;
|
||||
CleanCommonRadioButton: TRadioButton;
|
||||
CleanOnceCheckBox: TCheckBox;
|
||||
CommonsDividerBevel: TDividerBevel;
|
||||
ConfirmBuildCheckBox: TCheckBox;
|
||||
DefinesButton: TButton;
|
||||
@ -87,7 +91,7 @@ type
|
||||
LCLWidgetTypeComboBox: TComboBox;
|
||||
OptionsLabel: TLabel;
|
||||
OptionsMemo: TMemo;
|
||||
CleanUpRadioGroup: TRadioGroup;
|
||||
CleanUpGroupBox: TGroupBox;
|
||||
RestartAfterBuildCheckBox: TCheckBox;
|
||||
ShowOptsMenuItem: TMenuItem;
|
||||
DetailsPanel: TPanel;
|
||||
@ -200,12 +204,14 @@ var
|
||||
ExOptions: String;
|
||||
WorkingDirectory: String;
|
||||
OutputDirRedirected, UpdateRevisionInc: boolean;
|
||||
IdeBuildMode: TIdeBuildMode;
|
||||
begin
|
||||
Result:=mrCancel;
|
||||
|
||||
Options:=Profiles.Current;
|
||||
if LazarusIDE<>nil then
|
||||
LazarusIDE.MainBarSubTitle:=Options.Name;
|
||||
IdeBuildMode:=Options.IdeBuildMode;
|
||||
|
||||
Tool:=TExternalToolOptions.Create;
|
||||
try
|
||||
@ -232,7 +238,8 @@ begin
|
||||
Tool.ScanOutputForMakeMessages:=true;
|
||||
|
||||
// clean up
|
||||
if (Options.IdeBuildMode=bmCleanAllBuild) and ([blfDontCleanAll,blfOnlyIDE]*Flags=[]) then begin
|
||||
if (IdeBuildMode=bmCleanAllBuild) and ([blfDontCleanAll,blfOnlyIDE]*Flags=[])
|
||||
then begin
|
||||
WorkingDirectory:=EnvironmentOptions.GetParsedLazarusDirectory;
|
||||
if not CheckDirectoryWritable(WorkingDirectory) then exit(mrCancel);
|
||||
|
||||
@ -248,16 +255,19 @@ begin
|
||||
Tool.CmdLineParams:=Tool.CmdLineParams+' CPU_TARGET='+Options.FPCTargetCPU;
|
||||
Result:=ExternalTools.Run(Tool,Macros,false);
|
||||
if Result<>mrOk then exit;
|
||||
|
||||
if Options.CleanOnce then
|
||||
Options.IdeBuildMode:=bmBuild;
|
||||
end;
|
||||
|
||||
// build IDE
|
||||
if not (blfDontBuild in Flags) then begin
|
||||
WorkingDirectory:=EnvironmentOptions.GetParsedLazarusDirectory;
|
||||
if blfDontCleanAll in Flags then
|
||||
Options.IdeBuildMode:=bmBuild;
|
||||
IdeBuildMode:=bmBuild;
|
||||
Tool.Title:=lisIDE;
|
||||
Tool.WorkingDirectory:=WorkingDirectory;
|
||||
if Options.IdeBuildMode=bmCleanBuild then
|
||||
if IdeBuildMode=bmCleanBuild then
|
||||
Tool.CmdLineParams:='cleanide ide'
|
||||
else
|
||||
Tool.CmdLineParams:='ide'; // bmBuild or bmCleanAllBuild
|
||||
@ -286,6 +296,8 @@ begin
|
||||
// run
|
||||
Result:=ExternalTools.Run(Tool,Macros,false);
|
||||
if Result<>mrOk then exit;
|
||||
if Options.CleanOnce then
|
||||
Options.IdeBuildMode:=bmBuild;
|
||||
end;
|
||||
Result:=mrOk;
|
||||
finally
|
||||
@ -642,11 +654,6 @@ begin
|
||||
IDEDialogLayoutList.ApplyLayout(Self,700,480);
|
||||
|
||||
Caption := Format(lisConfigureBuildLazarus, ['"', '"']);
|
||||
CleanUpRadioGroup.Caption:=lisCleanUp;
|
||||
CleanUpRadioGroup.Items.Add(lisAutomatically);
|
||||
CleanUpRadioGroup.Items.Add(lisCleanCommonFiles);
|
||||
CleanUpRadioGroup.Items.Add(lisCleanAll);
|
||||
CleanUpRadioGroup.ItemIndex:=0;
|
||||
|
||||
// Show Build target names in combobox.
|
||||
LCLWidgetTypeLabel.Caption := lisLCLWidgetType;
|
||||
@ -654,41 +661,46 @@ begin
|
||||
LCLWidgetTypeComboBox.Items.Add(LCLPlatformDisplayNames[LCLInterface]);
|
||||
|
||||
BuildProfileLabel.Caption:=lisLazBuildProfile;
|
||||
BuildProfileButton.Hint := lisLazBuildManageProfiles2;
|
||||
BuildProfileComboBox.Hint := lisLazBuildNameOfTheActiveProfile;
|
||||
OptionsLabel.Caption := lisLazBuildOptions;
|
||||
TargetOSLabel.Caption := lisLazBuildTargetOS;
|
||||
TargetCPULabel.Caption := lisLazBuildTargetCPU;
|
||||
TargetDirectoryLabel.Caption := lisLazBuildTargetDirectory;
|
||||
|
||||
DefinesListBox.Hint := lisLazBuildDefinesWithoutD;
|
||||
DefinesLabel.Caption := lisLazBuildDefines;
|
||||
DefinesButton.Caption := lisLazBuildEditDefines;
|
||||
DefinesButton.Hint := lisLazBuildEditListOfDefinesWhichCanBeUsedByAnyProfile;
|
||||
|
||||
CleanUpGroupBox.Caption:=lisCleanUp;
|
||||
CleanAutoRadioButton.Caption:=lisAutomatically;
|
||||
CleanCommonRadioButton.Caption:=lisCleanCommonFiles;
|
||||
CleanAllRadioButton.Caption:=lisCleanAll;
|
||||
CleanOnceCheckBox.Caption:=lisCleanOnlyOnce;
|
||||
CleanOnceCheckBox.Hint:=lisAfterCleaningUpSwitchToAutomaticClean;
|
||||
|
||||
UpdateRevisionIncCheckBox.Caption := lisLazBuildUpdateRevInc;
|
||||
UpdateRevisionIncCheckBox.Hint := lisLazBuildUpdateRevisionInfoInAboutLazarusDialog;
|
||||
|
||||
CommonsDividerBevel.Caption := lisLazBuildCommonSettings;
|
||||
RestartAfterBuildCheckBox.Caption := lisLazBuildRestartAfterBuild;
|
||||
RestartAfterBuildCheckBox.Hint := lisLazBuildRestartLazarusAutomatically;
|
||||
ConfirmBuildCheckBox.Caption := lisLazBuildConfirmBuild;
|
||||
ConfirmBuildCheckBox.Hint := lisLazBuildShowConfirmationDialogWhenBuilding;
|
||||
|
||||
CompileButton.Caption := lisBuild;
|
||||
CompileAdvancedButton.Caption := lisLazBuildBuildMany;
|
||||
SaveSettingsButton.Caption := lisSaveSettings;
|
||||
CancelButton.Caption := lisCancel;
|
||||
HelpButton.Caption := lisMenuHelp;
|
||||
|
||||
DefinesLabel.Caption := lisLazBuildDefines;
|
||||
DefinesButton.Caption := lisLazBuildEditDefines;
|
||||
|
||||
BuildProfileComboBox.Hint := lisLazBuildNameOfTheActiveProfile;
|
||||
BuildProfileButton.Hint := lisLazBuildManageProfiles2;
|
||||
CleanUpRadioGroup.Hint := Format(lisLazBuildIdeBuildHint, [LineEnding, LineEnding]);
|
||||
DefinesListBox.Hint := lisLazBuildDefinesWithoutD;
|
||||
OptionsMemo.Hint := lisLazBuildOptionsPassedToCompiler;
|
||||
UpdateRevisionIncCheckBox.Hint := lisLazBuildUpdateRevisionInfoInAboutLazarusDialog;
|
||||
RestartAfterBuildCheckBox.Hint := lisLazBuildRestartLazarusAutomatically;
|
||||
ConfirmBuildCheckBox.Hint := lisLazBuildShowConfirmationDialogWhenBuilding;
|
||||
DefinesButton.Hint := lisLazBuildEditListOfDefinesWhichCanBeUsedByAnyProfile;
|
||||
|
||||
CompileButton.LoadGlyphFromLazarusResource('menu_build');
|
||||
CompileAdvancedButton.Caption := lisLazBuildBuildMany;
|
||||
CompileAdvancedButton.LoadGlyphFromLazarusResource('menu_build_all');
|
||||
SaveSettingsButton.Caption := lisSaveSettings;
|
||||
SaveSettingsButton.LoadGlyphFromStock(idButtonSave);
|
||||
if SaveSettingsButton.Glyph.Empty then
|
||||
SaveSettingsButton.LoadGlyphFromLazarusResource('laz_save');
|
||||
CancelButton.Caption := lisCancel;
|
||||
HelpButton.Caption := lisMenuHelp;
|
||||
|
||||
OptionsMemo.Hint := lisLazBuildOptionsPassedToCompiler;
|
||||
|
||||
with TargetOSComboBox do
|
||||
begin
|
||||
@ -796,7 +808,12 @@ begin
|
||||
TargetOSComboBox.Text :=AProfile.TargetOS;
|
||||
TargetDirectoryComboBox.Text :=AProfile.TargetDirectory;
|
||||
TargetCPUComboBox.Text :=AProfile.TargetCPU;
|
||||
CleanUpRadioGroup.ItemIndex :=ord(AProfile.IdeBuildMode);
|
||||
case AProfile.IdeBuildMode of
|
||||
bmBuild: CleanAutoRadioButton.Checked:=true;
|
||||
bmCleanBuild: CleanCommonRadioButton.Checked:=true;
|
||||
bmCleanAllBuild: CleanAllRadioButton.Checked:=true;
|
||||
end;
|
||||
CleanOnceCheckBox.Checked:=AProfile.CleanOnce;
|
||||
OptionsMemo.Lines.Assign(AProfile.OptionsLines);
|
||||
for i:=0 to DefinesListBox.Items.Count-1 do
|
||||
DefinesListBox.Checked[i]:=AProfile.Defines.IndexOf(DefinesListBox.Items[i]) > -1;
|
||||
@ -811,7 +828,13 @@ begin
|
||||
AProfile.TargetOS :=TargetOSComboBox.Text;
|
||||
AProfile.TargetDirectory :=TargetDirectoryComboBox.Text;
|
||||
AProfile.TargetCPU :=TargetCPUComboBox.Text;
|
||||
AProfile.IdeBuildMode :=TIdeBuildMode(CleanUpRadioGroup.ItemIndex);
|
||||
if CleanAllRadioButton.Checked then
|
||||
AProfile.IdeBuildMode := bmCleanAllBuild
|
||||
else if CleanCommonRadioButton.Checked then
|
||||
AProfile.IdeBuildMode := bmCleanBuild
|
||||
else
|
||||
AProfile.IdeBuildMode := bmBuild;
|
||||
AProfile.CleanOnce:=CleanOnceCheckBox.Checked;
|
||||
AProfile.OptionsLines.Assign(OptionsMemo.Lines);
|
||||
AProfile.Defines.Clear;
|
||||
for i:=0 to DefinesListBox.Items.Count-1 do
|
||||
|
||||
@ -51,6 +51,7 @@ type
|
||||
|
||||
TBuildLazarusProfile = class
|
||||
private
|
||||
FCleanOnce: boolean;
|
||||
fOwnerCnt: TBuildLazarusProfiles;
|
||||
fName: string;
|
||||
fTargetOS: string;
|
||||
@ -80,6 +81,7 @@ type
|
||||
property TargetCPU: string read fTargetCPU write fTargetCPU;
|
||||
property TargetPlatform: TLCLPlatform read fTargetPlatform write fTargetPlatform;
|
||||
property IdeBuildMode: TIdeBuildMode read fIdeBuildMode write fIdeBuildMode;
|
||||
property CleanOnce: boolean read FCleanOnce write FCleanOnce;
|
||||
property UpdateRevisionInc: boolean read fUpdateRevisionInc write fUpdateRevisionInc;
|
||||
property OptionsLines: TStringList read fOptions;
|
||||
property Defines: TStringList read fDefines;
|
||||
@ -217,6 +219,7 @@ begin
|
||||
FTargetDirectory:=AppendPathDelim(SetDirSeparators(
|
||||
XMLConfig.GetValue(Path+'TargetDirectory/Value', DefaultTargetDirectory)));
|
||||
IdeBuildMode:=StrToIdeBuildMode(XMLConfig.GetValue(Path+'IdeBuildMode/Value',''));
|
||||
CleanOnce:=XMLConfig.GetValue(Path+'CleanOnce/Value',false);
|
||||
FUpdateRevisionInc :=XMLConfig.GetValue(Path+'UpdateRevisionInc/Value',true);
|
||||
LoadStringList(XMLConfig,fOptions,Path+'Options/');
|
||||
if fOptions.Count=0 then // Support a syntax used earlier by profiles.
|
||||
@ -234,6 +237,7 @@ begin
|
||||
XMLConfig.SetDeleteValue(Path+'TargetDirectory/Value',
|
||||
FTargetDirectory,DefaultTargetDirectory);
|
||||
XMLConfig.SetDeleteValue(Path+'IdeBuildMode/Value',IdeBuildModeToStr(IdeBuildMode),'');
|
||||
XMLConfig.SetDeleteValue(Path+'CleanOnce/Value',CleanOnce,false);
|
||||
XMLConfig.SetDeleteValue(Path+'UpdateRevisionInc/Value',FUpdateRevisionInc,true);
|
||||
SaveStringList(XMLConfig,fOptions,Path+'Options/');
|
||||
SaveStringList(XMLConfig,fDefines,Path+'Defines/');
|
||||
@ -249,6 +253,7 @@ begin
|
||||
TargetCPU :=Source.TargetCPU;
|
||||
TargetPlatform :=Source.TargetPlatform;
|
||||
IdeBuildMode :=Source.IdeBuildMode;
|
||||
CleanOnce :=Source.CleanOnce;
|
||||
UpdateRevisionInc :=Source.UpdateRevisionInc;
|
||||
fOptions.Assign(Source.fOptions);
|
||||
fDefines.Assign(Source.fDefines);
|
||||
|
||||
@ -2958,6 +2958,9 @@ resourcestring
|
||||
lisAutomatically = 'Automatically';
|
||||
lisCleanCommonFiles = 'Clean common files';
|
||||
lisCleanAll = 'Clean all';
|
||||
lisCleanOnlyOnce = 'Clean only once';
|
||||
lisAfterCleaningUpSwitchToAutomaticClean = 'After cleaning up, switch to '
|
||||
+'automatic clean';
|
||||
lisLazBuildManageProfiles ='Manage Build Profiles';
|
||||
lisLazBuildProfile ='Profile to build';
|
||||
lisLazBuildRefresh ='Refresh';
|
||||
@ -2976,9 +2979,6 @@ resourcestring
|
||||
lisLazBuildEditDefinesDialogCaption = 'Edit Defines';
|
||||
lisLazBuildNameOfTheActiveProfile = 'Name of the active profile';
|
||||
lisLazBuildManageProfiles2 = 'Manage profiles';
|
||||
lisLazBuildIdeBuildHint = 'Build = "make ide", %s'+
|
||||
'Clean + Build = "make cleanide ide", %s' +
|
||||
'Clean All + Build = "make cleanlaz ide"';
|
||||
lisLazBuildDefinesWithoutD = 'Defines without -d';
|
||||
lisLazBuildOptionsPassedToCompiler = 'Options passed to compiler';
|
||||
lisLazBuildUpdateRevisionInfoInAboutLazarusDialog = 'Update revision info '
|
||||
|
||||
Loading…
Reference in New Issue
Block a user