ide: don't increase build in version info too often. do it once before build (maybe fixes bug #0013369)

git-svn-id: trunk@19072 -
This commit is contained in:
paul 2009-03-23 10:01:52 +00:00
parent 9713e8b48c
commit 45c85c3a98
4 changed files with 25 additions and 3 deletions

View File

@ -9126,6 +9126,7 @@ begin
DebugLn('TMainIDE.DoSaveForBuild Project1.IsVirtual=',dbgs(Project1.IsVirtual));
{$ENDIF}
Project1.Resources.DoBeforeBuild;
if not Project1.IsVirtual then
Result:=DoSaveAll([sfCheckAmbiguousFiles])
else

View File

@ -81,6 +81,7 @@ type
procedure AddSystemResource(const AResource: String); override;
procedure AddLazarusResource(AResource: TStream; const ResourceName, ResourceType: String); override;
procedure DoBeforeBuild;
procedure Clear;
function Regenerate(const MainFileName: String; UpdateSource, PerformSave: Boolean): Boolean;
function RenameDirectives(const CurFileName, NewFileName: String): Boolean;
@ -211,6 +212,13 @@ begin
end;
end;
procedure TProjectResources.DoBeforeBuild;
begin
VersionInfo.DoBeforeBuild(Self);
XPManifest.DoBeforeBuild(Self);
ProjectIcon.DoBeforeBuild(Self);
end;
procedure TProjectResources.Clear;
begin
FSystemResources.Clear;

View File

@ -84,6 +84,7 @@ type
procedure SetUseVersionInfo(const AValue: boolean);
procedure SetVersionNr(const AValue: integer);
public
procedure DoBeforeBuild(AResources: TAbstractProjectResources); override;
function UpdateResources(AResources: TAbstractProjectResources; const MainFilename: string): Boolean; override;
property UseVersionInfo: boolean read FUseVersionInfo write SetUseVersionInfo;
@ -318,8 +319,6 @@ begin
if UseVersionInfo then
begin
// project indicates to use the versioninfo
if AutoIncrementBuild then // project indicate to use autoincrementbuild
BuildNr := BuildNr + 1;
if ProductVersionString = '' then
ProductVersionString := IntToStr(VersionNr) + '.' +
IntToStr(MajorRevNr) + '.' +
@ -511,6 +510,13 @@ begin
Modified:=true;
end;
procedure TProjectVersionInfo.DoBeforeBuild(
AResources: TAbstractProjectResources);
begin
if AutoIncrementBuild then // project indicate to use autoincrementbuild
BuildNr := BuildNr + 1;
end;
finalization
FreeAndNil(fHexCharSets);
FreeAndNil(fHexLanguages);

View File

@ -29,9 +29,11 @@ type
FOnModified: TNotifyEvent;
procedure SetModified(const AValue: boolean);
public
constructor Create; virtual;
procedure DoBeforeBuild(AResources: TAbstractProjectResources); virtual;
function UpdateResources(AResources: TAbstractProjectResources; const MainFilename: string): Boolean; virtual; abstract;
constructor Create; virtual;
property Modified: boolean read FModified write SetModified;
property OnModified: TNotifyEvent read FOnModified write FOnModified;
end;
@ -68,6 +70,11 @@ begin
FModified := False;
end;
procedure TAbstractProjectResource.DoBeforeBuild(AResources: TAbstractProjectResources);
begin
// nothing
end;
{ TAbstractProjectResources }
constructor TAbstractProjectResources.Create;