mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 20:49:27 +02:00
IDE: unified changestamp
git-svn-id: trunk@36046 -
This commit is contained in:
parent
a6537c8ebe
commit
587f6e9dcc
@ -255,8 +255,8 @@ end;
|
||||
constructor TBuildManager.Create(AOwner: TComponent);
|
||||
begin
|
||||
DefaultCfgVars:=TCTCfgScriptVariables.Create;
|
||||
DefaultCfgVarsBuildMacroStamp:=InvalidParseStamp;
|
||||
FFPCVerChangeStamp:=InvalidParseStamp;
|
||||
DefaultCfgVarsBuildMacroStamp:=CTInvalidChangeStamp;
|
||||
FFPCVerChangeStamp:=CTInvalidChangeStamp;
|
||||
MainBuildBoss:=Self;
|
||||
inherited Create(AOwner);
|
||||
fTargetOS:=GetDefaultTargetOS;
|
||||
|
@ -1761,7 +1761,7 @@ var
|
||||
i: TInheritedCompilerOption;
|
||||
p: TCompilerOptionsParseType;
|
||||
begin
|
||||
fInheritedOptParseStamps:=InvalidParseStamp;
|
||||
fInheritedOptParseStamps:=CTInvalidChangeStamp;
|
||||
for p:=Low(TCompilerOptionsParseType) to High(TCompilerOptionsParseType) do
|
||||
for i:=Low(TInheritedCompilerOption) to High(TInheritedCompilerOption) do
|
||||
begin
|
||||
@ -3688,7 +3688,7 @@ end;
|
||||
|
||||
function TParsedCompilerOptions.HasParsedError: boolean;
|
||||
begin
|
||||
Result:=(ParsedErrorStamp<>InvalidParseStamp)
|
||||
Result:=(ParsedErrorStamp<>CTInvalidChangeStamp)
|
||||
and (ParsedErrorStamp=CompilerParseStamp);
|
||||
end;
|
||||
|
||||
@ -3803,8 +3803,8 @@ begin
|
||||
if Option=pcosBaseDir then
|
||||
InvalidateFiles
|
||||
else begin
|
||||
ParsedStamp[Option]:=InvalidParseStamp;
|
||||
ParsedPIStamp[Option]:=InvalidParseStamp;
|
||||
ParsedStamp[Option]:=CTInvalidChangeStamp;
|
||||
ParsedPIStamp[Option]:=CTInvalidChangeStamp;
|
||||
end;
|
||||
UnparsedValues[Option]:=NewValue;
|
||||
end;
|
||||
@ -3898,12 +3898,12 @@ var
|
||||
begin
|
||||
for Option:=Low(TParsedCompilerOptString) to High(TParsedCompilerOptString) do
|
||||
begin
|
||||
ParsedStamp[Option]:=InvalidParseStamp;
|
||||
ParsedPIStamp[Option]:=InvalidParseStamp;
|
||||
ParsedStamp[Option]:=CTInvalidChangeStamp;
|
||||
ParsedPIStamp[Option]:=CTInvalidChangeStamp;
|
||||
end;
|
||||
InheritedMacroValuesStamp:=InvalidParseStamp;
|
||||
MacroValuesStamp:=InvalidParseStamp;
|
||||
ParsedErrorStamp:=InvalidParseStamp;
|
||||
InheritedMacroValuesStamp:=CTInvalidChangeStamp;
|
||||
MacroValuesStamp:=CTInvalidChangeStamp;
|
||||
ParsedErrorStamp:=CTInvalidChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TParsedCompilerOptions.InvalidateFiles;
|
||||
@ -3912,8 +3912,8 @@ var
|
||||
begin
|
||||
for Option:=Low(TParsedCompilerOptString) to High(TParsedCompilerOptString) do
|
||||
if (Option in ParsedCompilerFiles) then begin
|
||||
ParsedStamp[Option]:=InvalidParseStamp;
|
||||
ParsedPIStamp[Option]:=InvalidParseStamp;
|
||||
ParsedStamp[Option]:=CTInvalidChangeStamp;
|
||||
ParsedPIStamp[Option]:=CTInvalidChangeStamp;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -171,6 +171,25 @@ var
|
||||
ExternalToolListClass: TExternalToolListClass; // set by ExtToolDialog
|
||||
|
||||
type
|
||||
TParsedEnvOptType = (
|
||||
peoLazarusDirectory,
|
||||
peoCompilerFilename,
|
||||
peopFPCSourceDirectory,
|
||||
peoTestBuildDirectory,
|
||||
peoDebuggerFilename,
|
||||
peoMakeFilename,
|
||||
peoDebuggerSearchPath,
|
||||
peoFPDocPaths,
|
||||
peoCompilerMessagesFilename
|
||||
);
|
||||
TParsedEnvOptTypes = set of TParsedEnvOptType;
|
||||
TParsedEnvOption = record
|
||||
Value: string;
|
||||
ParseStamp: integer;
|
||||
end;
|
||||
|
||||
type
|
||||
|
||||
{ TEnvironmentOptions - class for storing environment options }
|
||||
|
||||
TEnvironmentOptions = class(TAbstractIDEEnvironmentOptions)
|
||||
@ -245,7 +264,7 @@ type
|
||||
|
||||
// compiler + debugger + lazarus files
|
||||
FLazarusDirectory: string;
|
||||
FLazarusDirsHistory: TStringList;
|
||||
FLazarusDirHistory: TStringList;
|
||||
FCompilerFilename: string;
|
||||
FCompilerFilenameParsed: string;
|
||||
FCompilerFilenameParsedStamp: integer;
|
||||
@ -346,9 +365,10 @@ type
|
||||
procedure Save(OnlyDesktop:boolean);
|
||||
property Filename: string read FFilename write SetFilename;
|
||||
procedure CreateConfig;
|
||||
function GetLazarusDirectory: string;
|
||||
function GetTestBuildDirectory: string;
|
||||
function GetFPCSourceDirectory: string;
|
||||
function GetCompilerFilename: string;
|
||||
function GetFPCSourceDirectory: string;
|
||||
|
||||
// macro functions
|
||||
procedure InitMacros(AMacroList: TTransferMacroList);
|
||||
@ -459,8 +479,8 @@ type
|
||||
// files
|
||||
property LazarusDirectory: string read FLazarusDirectory
|
||||
write SetLazarusDirectory;
|
||||
property LazarusDirHistory: TStringList read FLazarusDirsHistory
|
||||
write FLazarusDirsHistory;
|
||||
property LazarusDirHistory: TStringList read FLazarusDirHistory
|
||||
write FLazarusDirHistory;
|
||||
property CompilerFilename: string read FCompilerFilename
|
||||
write SetCompilerFilename;
|
||||
property CompilerFileHistory: TStringList read FCompilerFileHistory
|
||||
@ -780,12 +800,12 @@ begin
|
||||
|
||||
// files
|
||||
LazarusDirectory:=IDEProcs.ProgramDirectory(true);
|
||||
FLazarusDirsHistory:=TStringList.Create;
|
||||
FLazarusDirHistory:=TStringList.Create;
|
||||
CompilerFilename:='';
|
||||
FCompilerFilenameParsedStamp:=InvalidParseStamp;
|
||||
FCompilerFilenameParsedStamp:=CTInvalidChangeStamp;
|
||||
FCompilerFileHistory:=TStringList.Create;
|
||||
FPCSourceDirectory:='';
|
||||
FFPCSrcDirParsedStamp:=InvalidParseStamp;
|
||||
FFPCSrcDirParsedStamp:=CTInvalidChangeStamp;
|
||||
FFPCSourceDirHistory:=TStringList.Create;
|
||||
MakeFilename:='';
|
||||
FMakeFileHistory:=TStringList.Create;
|
||||
@ -850,7 +870,7 @@ begin
|
||||
FreeAndNil(FRecentProjectFiles);
|
||||
FreeAndNil(FRecentPackageFiles);
|
||||
FreeAndNil(FObjectInspectorOptions);
|
||||
FreeAndNil(FLazarusDirsHistory);
|
||||
FreeAndNil(FLazarusDirHistory);
|
||||
FreeAndNil(FCompilerFileHistory);
|
||||
FreeAndNil(FFPCSourceDirHistory);
|
||||
FreeAndNil(FMakeFileHistory);
|
||||
@ -899,6 +919,11 @@ begin
|
||||
Filename:=ConfFilename;
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetLazarusDirectory: string;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.SetFileName(const NewFilename: string);
|
||||
begin
|
||||
if FFilename=NewFilename then exit;
|
||||
@ -1079,10 +1104,10 @@ begin
|
||||
if not FilenameIsAbsolute(s) then
|
||||
s:=TrimFilename(AppendPathDelim(GetPrimaryConfigPath)+s);
|
||||
LazarusDirectory:=s;
|
||||
LoadRecentList(XMLConfig,FLazarusDirsHistory,
|
||||
LoadRecentList(XMLConfig,FLazarusDirHistory,
|
||||
Path+'LazarusDirectory/History/');
|
||||
if FLazarusDirsHistory.Count=0 then
|
||||
FLazarusDirsHistory.Add(ProgramDirectory(true));
|
||||
if FLazarusDirHistory.Count=0 then
|
||||
FLazarusDirHistory.Add(ProgramDirectory(true));
|
||||
CompilerFilename:=TrimFilename(XMLConfig.GetValue(
|
||||
Path+'CompilerFilename/Value',FCompilerFilename));
|
||||
LoadRecentList(XMLConfig,FCompilerFileHistory,
|
||||
@ -1427,7 +1452,7 @@ begin
|
||||
CurLazDir:=CreateRelativePath(CurLazDir,GetPrimaryConfigPath);
|
||||
end;
|
||||
XMLConfig.SetDeleteValue(Path+'LazarusDirectory/Value',CurLazDir,'');
|
||||
SaveRecentList(XMLConfig,FLazarusDirsHistory,
|
||||
SaveRecentList(XMLConfig,FLazarusDirHistory,
|
||||
Path+'LazarusDirectory/History/');
|
||||
XMLConfig.SetDeleteValue(
|
||||
Path+'CompilerFilename/Value',FCompilerFilename,'');
|
||||
@ -1643,7 +1668,7 @@ end;
|
||||
|
||||
function TEnvironmentOptions.GetFPCSourceDirectory: string;
|
||||
begin
|
||||
if (FFPCSrcDirParsedStamp=InvalidParseStamp)
|
||||
if (FFPCSrcDirParsedStamp=CTInvalidChangeStamp)
|
||||
or (FFPCSrcDirParsedStamp<>CompilerParseStamp)
|
||||
then begin
|
||||
FFPCSrcDirParsed:=FFPCSourceDirectory;
|
||||
@ -1655,7 +1680,7 @@ end;
|
||||
|
||||
function TEnvironmentOptions.GetCompilerFilename: string;
|
||||
begin
|
||||
if (FCompilerFilenameParsedStamp=InvalidParseStamp)
|
||||
if (FCompilerFilenameParsedStamp=CTInvalidChangeStamp)
|
||||
or (FCompilerFilenameParsedStamp<>CompilerParseStamp)
|
||||
then begin
|
||||
FCompilerFilenameParsed:=FCompilerFilename;
|
||||
@ -1837,14 +1862,14 @@ procedure TEnvironmentOptions.SetFPCSourceDirectory(const AValue: string);
|
||||
begin
|
||||
if FFPCSourceDirectory=AValue then exit;
|
||||
FFPCSourceDirectory:=AppendPathDelim(TrimFilename(AValue));
|
||||
FFPCSrcDirParsedStamp:=InvalidParseStamp;
|
||||
FFPCSrcDirParsedStamp:=CTInvalidChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TEnvironmentOptions.SetCompilerFilename(const AValue: string);
|
||||
begin
|
||||
if FCompilerFilename=AValue then exit;
|
||||
FCompilerFilename:=TrimFilename(AValue);
|
||||
FCompilerFilenameParsedStamp:=InvalidParseStamp;
|
||||
FCompilerFilenameParsedStamp:=CTInvalidChangeStamp;
|
||||
end;
|
||||
|
||||
function TEnvironmentOptions.GetDebuggerEventLogColors(AIndex: TDBGEventType): TDebuggerEventLogColor;
|
||||
|
@ -6670,7 +6670,7 @@ constructor TProjectBuildMacros.Create;
|
||||
begin
|
||||
FItems:=TStringList.Create;
|
||||
FCfgVars:=TCTCfgScriptVariables.Create;
|
||||
FCfgVarsBuildMacroStamp:=InvalidParseStamp;
|
||||
FCfgVarsBuildMacroStamp:=CTInvalidChangeStamp;
|
||||
FChangeStamp:=CTInvalidChangeStamp;
|
||||
fOnChanged:=TMethodList.Create;
|
||||
end;
|
||||
|
@ -45,7 +45,8 @@ unit TransferMacros;
|
||||
|
||||
interface
|
||||
|
||||
uses Classes, SysUtils, LCLProc, FileUtil, LazarusIDEStrConsts, MacroIntf;
|
||||
uses Classes, SysUtils, LCLProc, FileUtil, FileProcs, LazarusIDEStrConsts,
|
||||
MacroIntf;
|
||||
|
||||
type
|
||||
TTransferMacro = class;
|
||||
@ -134,16 +135,12 @@ type
|
||||
var
|
||||
GlobalMacroList: TTransferMacroList = nil;
|
||||
|
||||
const
|
||||
MaxParseStamp = $7fffffff;
|
||||
MinParseStamp = -$7fffffff;
|
||||
InvalidParseStamp = MinParseStamp-1;
|
||||
type
|
||||
TCompilerParseStampIncreasedEvent = procedure of object;
|
||||
var
|
||||
CompilerParseStamp: integer; // TimeStamp of base value for macros
|
||||
CompilerParseStamp: integer = 0; // TimeStamp of base value for macros
|
||||
CompilerParseStampIncreased: TCompilerParseStampIncreasedEvent = nil;
|
||||
BuildMacroChangeStamp: integer; // TimeStamp of base value for build macros
|
||||
BuildMacroChangeStamp: integer = 0; // TimeStamp of base value for build macros
|
||||
|
||||
procedure IncreaseCompilerParseStamp;
|
||||
procedure IncreaseBuildMacroChangeStamp; { called when a package dependency change
|
||||
@ -157,10 +154,7 @@ var
|
||||
|
||||
procedure IncreaseCompilerParseStamp;
|
||||
begin
|
||||
if CompilerParseStamp<MaxParseStamp then
|
||||
inc(CompilerParseStamp)
|
||||
else
|
||||
CompilerParseStamp:=MinParseStamp;
|
||||
CTIncreaseChangeStamp(CompilerParseStamp);
|
||||
if Assigned(CompilerParseStampIncreased) then
|
||||
CompilerParseStampIncreased();
|
||||
end;
|
||||
@ -168,10 +162,7 @@ end;
|
||||
procedure IncreaseBuildMacroChangeStamp;
|
||||
begin
|
||||
IncreaseCompilerParseStamp;
|
||||
if BuildMacroChangeStamp<MaxParseStamp then
|
||||
inc(BuildMacroChangeStamp)
|
||||
else
|
||||
BuildMacroChangeStamp:=MinParseStamp;
|
||||
CTIncreaseChangeStamp(BuildMacroChangeStamp);
|
||||
end;
|
||||
|
||||
{ TTransferMacro }
|
||||
|
@ -1497,7 +1497,7 @@ begin
|
||||
DoDirSeparators(NewFilename);
|
||||
if Filename=NewFilename then exit;
|
||||
inherited SetFilename(NewFilename);
|
||||
fFullFilenameStamp:=InvalidParseStamp;
|
||||
fFullFilenameStamp:=CTInvalidChangeStamp;
|
||||
OldDirectory:=FDirectory;
|
||||
FDirectory:=ExtractFilePath(Filename);
|
||||
if OldDirectory<>FDirectory then begin
|
||||
@ -2406,7 +2406,7 @@ begin
|
||||
FDirectory:=FFilename
|
||||
else
|
||||
FDirectory:=ExtractFilePath(FFilename);
|
||||
FDirectoryExpandedChangeStamp:=InvalidParseStamp;
|
||||
FDirectoryExpandedChangeStamp:=CTInvalidChangeStamp;
|
||||
FHasDirectory:=(FDirectory<>'') and (FDirectory[length(FDirectory)]=PathDelim);
|
||||
FHasStaticDirectory:=FHasDirectory and FilenameIsAbsolute(FDirectory);
|
||||
FUsageOptions.BaseDirectory:=FDirectory;
|
||||
@ -2675,7 +2675,7 @@ begin
|
||||
FCompilerOptions.Clear;
|
||||
FDescription:='';
|
||||
FDirectory:='';
|
||||
FDirectoryExpandedChangeStamp:=InvalidParseStamp;
|
||||
FDirectoryExpandedChangeStamp:=CTInvalidChangeStamp;
|
||||
FEnableI18N:=false;
|
||||
FEnableI18NForLFM:=false;
|
||||
FPOOutputDirectory:='';
|
||||
|
Loading…
Reference in New Issue
Block a user