mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 09:27:31 +02:00
IDE: Reduce DebugLn() calls in Publish Module code. It seems to work.
git-svn-id: trunk@59263 -
This commit is contained in:
parent
82083bfa92
commit
e720b191ee
@ -160,10 +160,6 @@ begin
|
|||||||
+ EnvironmentOptions.BackupInfoProjectFiles.SubDirectory);
|
+ EnvironmentOptions.BackupInfoProjectFiles.SubDirectory);
|
||||||
COpts := FProjPack.LazCompilerOptions as TBaseCompilerOptions;
|
COpts := FProjPack.LazCompilerOptions as TBaseCompilerOptions;
|
||||||
FLibDir := COpts.GetUnitOutPath(True,coptParsed);
|
FLibDir := COpts.GetUnitOutPath(True,coptParsed);
|
||||||
DebugLn(['TPublisher: Source Directory = ', FSrcDir]);
|
|
||||||
DebugLn(['TPublisher: Destination Directory = ', FDestDir]);
|
|
||||||
DebugLn(['TPublisher: Backup Directory = ', FBackupDir]);
|
|
||||||
DebugLn(['TPublisher: Lib Directory = ', FLibDir]);
|
|
||||||
FCopiedFiles := TStringList.Create;
|
FCopiedFiles := TStringList.Create;
|
||||||
FProjDirs := TStringList.Create;
|
FProjDirs := TStringList.Create;
|
||||||
end;
|
end;
|
||||||
@ -183,33 +179,19 @@ var
|
|||||||
CurDir: string;
|
CurDir: string;
|
||||||
begin
|
begin
|
||||||
if FCopiedFiles.IndexOf(FileName) >= 0 then
|
if FCopiedFiles.IndexOf(FileName) >= 0 then
|
||||||
begin
|
|
||||||
DebugLn(['DoFileFound: Already copied file ', FileName]);
|
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
|
||||||
CurDir := ExtractFilePath(FileName);
|
CurDir := ExtractFilePath(FileName);
|
||||||
if (CurDir = FBackupDir) or (CurDir = FLibDir) then
|
if (CurDir = FBackupDir) or (CurDir = FLibDir) then
|
||||||
begin
|
|
||||||
DebugLn(['DoFileFound: In Backup or Output directory, not copied: ', FileName]);
|
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
|
||||||
if AnsiStartsStr(FDestDir, CurDir) then
|
if AnsiStartsStr(FDestDir, CurDir) then
|
||||||
begin
|
|
||||||
DebugLn(['DoFileFound: In destination directory, not copied: ', FileName]);
|
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
|
||||||
if FOptions.FileCanBePublished(FileName) then
|
if FOptions.FileCanBePublished(FileName) then
|
||||||
begin
|
|
||||||
if CopyAFile(FileName) <> mrOK then
|
if CopyAFile(FileName) <> mrOK then
|
||||||
Inc(FCopyFailedCount);
|
Inc(FCopyFailedCount);
|
||||||
end
|
|
||||||
else
|
|
||||||
DebugLn(['DoFileFound: Rejected file ', FileName]);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPublisher.DoDirectoryFound;
|
procedure TPublisher.DoDirectoryFound;
|
||||||
begin
|
begin
|
||||||
DebugLn(['DoDirectoryFound: ', FileName]);
|
|
||||||
// Directory is already created by the cffCreateDestDirectory flag.
|
// Directory is already created by the cffCreateDestDirectory flag.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -232,10 +214,7 @@ begin
|
|||||||
Adjusted := True;
|
Adjusted := True;
|
||||||
end;
|
end;
|
||||||
if Adjusted then
|
if Adjusted then
|
||||||
begin
|
|
||||||
FTopDir := ResolveDots(FTopDir);
|
FTopDir := ResolveDots(FTopDir);
|
||||||
DebugLn(['Adjusted TopDir: ', FTopDir, ' based on file ', AFilename]);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPublisher.CopyAFile(const AFileName: string): TModalResult;
|
function TPublisher.CopyAFile(const AFileName: string): TModalResult;
|
||||||
@ -249,9 +228,7 @@ begin
|
|||||||
Drive := ExtractFileDrive(RelPath);
|
Drive := ExtractFileDrive(RelPath);
|
||||||
if Trim(Drive) <> '' then
|
if Trim(Drive) <> '' then
|
||||||
RelPath := StringReplace(RelPath, AppendPathDelim(Drive), '', [rfIgnoreCase]);
|
RelPath := StringReplace(RelPath, AppendPathDelim(Drive), '', [rfIgnoreCase]);
|
||||||
DebugLn(['CopyAFile: File ', AFilename, ' -> ', FDestDir+RelPath]);
|
if CopyFile(AFilename, FDestDir+RelPath, [cffCreateDestDirectory,cffPreserveTime]) then
|
||||||
if CopyFile(AFilename, FDestDir + RelPath,
|
|
||||||
[cffCreateDestDirectory,cffPreserveTime]) then
|
|
||||||
begin
|
begin
|
||||||
FCopiedFiles.Add(AFilename);
|
FCopiedFiles.Add(AFilename);
|
||||||
if FilenameIsPascalUnit(AFilename) then
|
if FilenameIsPascalUnit(AFilename) then
|
||||||
@ -347,8 +324,6 @@ begin
|
|||||||
CurProject := TProject(FOptions.Owner);
|
CurProject := TProject(FOptions.Owner);
|
||||||
NewProjFilename := FDestDir + ExtractRelativePath(FTopDir, CurProject.ProjectInfoFile);
|
NewProjFilename := FDestDir + ExtractRelativePath(FTopDir, CurProject.ProjectInfoFile);
|
||||||
DeleteFileUTF8(NewProjFilename);
|
DeleteFileUTF8(NewProjFilename);
|
||||||
DebugLn(['WriteProjectInfo: ProjectInfo = ', CurProject.ProjectInfoFile,
|
|
||||||
', NewProjFilename = ', NewProjFilename]);
|
|
||||||
Assert(CurProject.PublishOptions = FOptions, 'CurProject.PublishOptions <> FOptions');
|
Assert(CurProject.PublishOptions = FOptions, 'CurProject.PublishOptions <> FOptions');
|
||||||
FCopiedFiles.Add(CurProject.ProjectInfoFile); // Do not later by filter.
|
FCopiedFiles.Add(CurProject.ProjectInfoFile); // Do not later by filter.
|
||||||
Result := CurProject.WriteProject(
|
Result := CurProject.WriteProject(
|
||||||
@ -510,7 +485,6 @@ begin
|
|||||||
FCopyFailedCount:=0;
|
FCopyFailedCount:=0;
|
||||||
for I := 0 to FProjDirs.Count - 1 do
|
for I := 0 to FProjDirs.Count - 1 do
|
||||||
begin
|
begin
|
||||||
DebugLn(['Copy extra directory ', FProjDirs.Strings[I]]);
|
|
||||||
if IsDrive(FProjDirs.Strings[I]) then
|
if IsDrive(FProjDirs.Strings[I]) then
|
||||||
Search(FProjDirs.Strings[I], '', False)
|
Search(FProjDirs.Strings[I], '', False)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user