mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 01:09:46 +02:00
IDE: build laz: when clean option is on, clean up fallback directories too
git-svn-id: trunk@47922 -
This commit is contained in:
parent
ddf953cb24
commit
842dc80fd5
@ -176,7 +176,6 @@ type
|
|||||||
function CheckDirectoryWritable(Dir: string): boolean;
|
function CheckDirectoryWritable(Dir: string): boolean;
|
||||||
procedure CleanDir(Dir: string; Recursive: boolean = true);
|
procedure CleanDir(Dir: string; Recursive: boolean = true);
|
||||||
procedure CleanLazarusSrcDir;
|
procedure CleanLazarusSrcDir;
|
||||||
procedure CleanLazarusFallbackOutDir;
|
|
||||||
procedure CheckRevisionInc;
|
procedure CheckRevisionInc;
|
||||||
procedure RestoreBackup;
|
procedure RestoreBackup;
|
||||||
// Methods used by SaveIDEMakeOptions :
|
// Methods used by SaveIDEMakeOptions :
|
||||||
@ -329,11 +328,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLazarusBuilder.CleanLazarusFallbackOutDir;
|
|
||||||
begin
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TLazarusBuilder.CheckRevisionInc;
|
procedure TLazarusBuilder.CheckRevisionInc;
|
||||||
var
|
var
|
||||||
RevisionIncFile: String;
|
RevisionIncFile: String;
|
||||||
@ -458,21 +452,40 @@ begin
|
|||||||
if Profile.TargetCPU<>'' then
|
if Profile.TargetCPU<>'' then
|
||||||
CmdLineParams+=' CPU_TARGET='+Profile.FPCTargetCPU+' CPU_SOURCE='+Profile.FPCTargetCPU;
|
CmdLineParams+=' CPU_TARGET='+Profile.FPCTargetCPU+' CPU_SOURCE='+Profile.FPCTargetCPU;
|
||||||
|
|
||||||
|
// append extra Profile
|
||||||
|
fExtraOptions:='';
|
||||||
|
Result:=CreateIDEMakeOptions(Flags);
|
||||||
|
if Result<>mrOk then exit;
|
||||||
|
|
||||||
fWorkingDir:=EnvironmentOptions.GetParsedLazarusDirectory;
|
fWorkingDir:=EnvironmentOptions.GetParsedLazarusDirectory;
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
if (IdeBuildMode<>bmBuild) and (not (blfDontClean in Flags)) then begin
|
if (IdeBuildMode<>bmBuild) and (not (blfDontClean in Flags)) then begin
|
||||||
if not CheckDirectoryWritable(fWorkingDir) then exit(mrCancel);
|
|
||||||
|
|
||||||
|
if not fOutputDirRedirected then begin
|
||||||
|
// clean up Lazarus sources
|
||||||
|
if not CheckDirectoryWritable(fWorkingDir) then exit(mrCancel);
|
||||||
|
|
||||||
|
if (IdeBuildMode=bmCleanAllBuild) and (not (blfOnlyIDE in Flags)) then
|
||||||
|
CleanLazarusSrcDir;
|
||||||
|
|
||||||
|
// call make to clean up
|
||||||
|
if (IdeBuildMode=bmCleanBuild) or (blfOnlyIDE in Flags) then
|
||||||
|
Cmd:='cleanide'
|
||||||
|
else
|
||||||
|
Cmd:='cleanlaz';
|
||||||
|
Result:=Run(lisCleanLazarusSource);
|
||||||
|
if Result<>mrOk then exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// when cleaning, always clean up fallback output directory too
|
||||||
if (IdeBuildMode=bmCleanAllBuild) and (not (blfOnlyIDE in Flags)) then
|
if (IdeBuildMode=bmCleanAllBuild) and (not (blfOnlyIDE in Flags)) then
|
||||||
CleanLazarusSrcDir;
|
begin
|
||||||
|
// clean up fallback package output directories
|
||||||
// call make to clean up
|
CleanDir(AppendPathDelim(GetPrimaryConfigPath)+'lib');
|
||||||
if (IdeBuildMode=bmCleanBuild) or (blfOnlyIDE in Flags) then
|
end;
|
||||||
Cmd:='cleanide'
|
// clean up fallback IDE output directory
|
||||||
else
|
CleanDir(AppendPathDelim(GetPrimaryConfigPath)+'units');
|
||||||
Cmd:='cleanlaz';
|
|
||||||
Result:=Run(lisCleanLazarusSource);
|
|
||||||
if Result<>mrOk then exit;
|
|
||||||
|
|
||||||
ApplyCleanOnce;
|
ApplyCleanOnce;
|
||||||
end;
|
end;
|
||||||
@ -485,10 +498,6 @@ begin
|
|||||||
Cmd:='idepkg'
|
Cmd:='idepkg'
|
||||||
else
|
else
|
||||||
Cmd:='cleanide ide';
|
Cmd:='cleanide ide';
|
||||||
// append extra Profile
|
|
||||||
fExtraOptions:='';
|
|
||||||
Result:=CreateIDEMakeOptions(Flags);
|
|
||||||
if Result<>mrOk then exit;
|
|
||||||
|
|
||||||
if (not fOutputDirRedirected) and (not CheckDirectoryWritable(fWorkingDir)) then
|
if (not fOutputDirRedirected) and (not CheckDirectoryWritable(fWorkingDir)) then
|
||||||
exit(mrCancel);
|
exit(mrCancel);
|
||||||
@ -1091,7 +1100,7 @@ begin
|
|||||||
bmCleanBuild: CleanCommonRadioButton.Checked:=true;
|
bmCleanBuild: CleanCommonRadioButton.Checked:=true;
|
||||||
bmCleanAllBuild: CleanAllRadioButton.Checked:=true;
|
bmCleanAllBuild: CleanAllRadioButton.Checked:=true;
|
||||||
end;
|
end;
|
||||||
CleanCommonCheckBox.Checked := AProfile.IdeBuildMode=bmCleanBuild;
|
CleanCommonCheckBox.Checked := AProfile.IdeBuildMode=bmCleanAllBuild;
|
||||||
CleanOnceCheckBox.Checked:=AProfile.CleanOnce;
|
CleanOnceCheckBox.Checked:=AProfile.CleanOnce;
|
||||||
OptionsMemo.Lines.Assign(AProfile.OptionsLines);
|
OptionsMemo.Lines.Assign(AProfile.OptionsLines);
|
||||||
for i:=0 to DefinesListBox.Items.Count-1 do
|
for i:=0 to DefinesListBox.Items.Count-1 do
|
||||||
@ -1351,14 +1360,14 @@ end;
|
|||||||
|
|
||||||
procedure TConfigureBuildLazarusDlg.CleanRadioButtonClick(Sender: TObject);
|
procedure TConfigureBuildLazarusDlg.CleanRadioButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CleanCommonCheckBox.Checked:=CleanCommonRadioButton.Checked;
|
CleanCommonCheckBox.Checked:=CleanAllRadioButton.Checked;
|
||||||
DebugLn(['TConfigureBuildLazarusDlg.CleanRadioButtonClick: set CleanCommonCheckBox to ', CleanCommonRadioButton.Checked]);
|
DebugLn(['TConfigureBuildLazarusDlg.CleanRadioButtonClick: set CleanCommonCheckBox to ', CleanCommonRadioButton.Checked]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TConfigureBuildLazarusDlg.CleanCommonCheckBoxClick(Sender: TObject);
|
procedure TConfigureBuildLazarusDlg.CleanCommonCheckBoxClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if CleanCommonCheckBox.Checked then
|
if CleanCommonCheckBox.Checked then
|
||||||
CleanCommonRadioButton.Checked:=True
|
CleanAllRadioButton.Checked:=True
|
||||||
else
|
else
|
||||||
CleanAutoRadioButton.Checked:=True;
|
CleanAutoRadioButton.Checked:=True;
|
||||||
DebugLn(['TConfigureBuildLazarusDlg.CleanCommonCheckBoxClick: set CleanCommonRadioButton to ', CleanCommonCheckBox.Checked]);
|
DebugLn(['TConfigureBuildLazarusDlg.CleanCommonCheckBoxClick: set CleanCommonRadioButton to ', CleanCommonCheckBox.Checked]);
|
||||||
|
Loading…
Reference in New Issue
Block a user