mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 21:39:31 +01:00
cody: unit dependencies: shorter fpc package names
git-svn-id: trunk@40380 -
This commit is contained in:
parent
44caf00ceb
commit
fd01c56742
@ -319,6 +319,25 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitDependenciesDialog.CreateFPCSrcGroups;
|
procedure TUnitDependenciesDialog.CreateFPCSrcGroups;
|
||||||
|
|
||||||
|
function ExtractFilePathStart(Filename: string; DirCount: integer): string;
|
||||||
|
var
|
||||||
|
p: Integer;
|
||||||
|
begin
|
||||||
|
p:=1;
|
||||||
|
while p<=length(Filename) do begin
|
||||||
|
if Filename[p]=PathDelim then begin
|
||||||
|
DirCount-=1;
|
||||||
|
if DirCount=0 then begin
|
||||||
|
Result:=LeftStr(Filename,p-1);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
inc(p);
|
||||||
|
end;
|
||||||
|
Result:=Filename;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
FPCSrcDir: String;
|
FPCSrcDir: String;
|
||||||
Node: TAVLTreeNode;
|
Node: TAVLTreeNode;
|
||||||
@ -328,6 +347,7 @@ var
|
|||||||
begin
|
begin
|
||||||
FPCSrcDir:=AppendPathDelim(GetFPCSrcDir);
|
FPCSrcDir:=AppendPathDelim(GetFPCSrcDir);
|
||||||
|
|
||||||
|
// for each unit in the fpc source directory, create a group for each directory
|
||||||
Node:=UsesGraph.FilesTree.FindLowest;
|
Node:=UsesGraph.FilesTree.FindLowest;
|
||||||
while Node<>nil do begin
|
while Node<>nil do begin
|
||||||
CurUnit:=TUGGroupUnit(Node.Data);
|
CurUnit:=TUGGroupUnit(Node.Data);
|
||||||
@ -337,12 +357,19 @@ begin
|
|||||||
// a unit in the FPC sources
|
// a unit in the FPC sources
|
||||||
Directory:=ExtractFilePath(CurUnit.Filename);
|
Directory:=ExtractFilePath(CurUnit.Filename);
|
||||||
Directory:=copy(Directory,length(FPCSrcDir)+1,length(Directory));
|
Directory:=copy(Directory,length(FPCSrcDir)+1,length(Directory));
|
||||||
|
Directory:=ExtractFilePathStart(Directory,2);
|
||||||
|
if LeftStr(Directory,length('rtl'))='rtl' then
|
||||||
|
Directory:='RTL'
|
||||||
|
else if LeftStr(Directory,length('packages'))='packages' then
|
||||||
|
System.Delete(Directory,1,length('packages'+PathDelim));
|
||||||
Grp:=Groups.GetGroup(GroupPrefixFPCSrc+Directory,true);
|
Grp:=Groups.GetGroup(GroupPrefixFPCSrc+Directory,true);
|
||||||
debugln(['TUnitDependenciesDialog.CreateFPCSrcGroups ',Grp.Name]);
|
debugln(['TUnitDependenciesDialog.CreateFPCSrcGroups ',Grp.Name]);
|
||||||
Grp.AddUnit(TUGGroupUnit(CurUnit));
|
Grp.AddUnit(TUGGroupUnit(CurUnit));
|
||||||
end;
|
end;
|
||||||
Node:=UsesGraph.FilesTree.FindSuccessor(Node);
|
Node:=UsesGraph.FilesTree.FindSuccessor(Node);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitDependenciesDialog.GuessGroupOfUnits;
|
procedure TUnitDependenciesDialog.GuessGroupOfUnits;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user