LazBuild: Support dots in package names. Issue #35166, patch from Imants Gulbis.

git-svn-id: trunk@60545 -
This commit is contained in:
juha 2019-02-28 21:18:29 +00:00
parent d4a8763c35
commit 5f5140a80c

View File

@ -327,8 +327,7 @@ begin
if TheProject.IsVirtual then if TheProject.IsVirtual then
CodeToolBoss.SetGlobalValue(ExternalMacroStart+'ProjPath',VirtualDirectory) CodeToolBoss.SetGlobalValue(ExternalMacroStart+'ProjPath',VirtualDirectory)
else else
CodeToolBoss.SetGlobalValue(ExternalMacroStart+'ProjPath', CodeToolBoss.SetGlobalValue(ExternalMacroStart+'ProjPath',Project1.Directory)
Project1.Directory)
end; end;
function TLazBuildApplication.OnIDEMessageDialog(const aCaption, aMsg: string; function TLazBuildApplication.OnIDEMessageDialog(const aCaption, aMsg: string;
@ -372,7 +371,7 @@ begin
if not FileExistsUTF8(Filename) then if not FileExistsUTF8(Filename) then
begin begin
// Check for packages if the specified name is a valid identifier // Check for packages if the specified name is a valid identifier
if LazIsValidIdent(OriginalFileName) then begin if PackageFileNameIsValid(OriginalFileName) then begin
if PackageAction=lpaAddPkgLinks then begin if PackageAction=lpaAddPkgLinks then begin
Error(ErrorFileNotFound,'lpk file expected, but '+OriginalFilename+' found'); Error(ErrorFileNotFound,'lpk file expected, but '+OriginalFilename+' found');
Exit; Exit;
@ -487,11 +486,10 @@ begin
XMLConfig.Free; XMLConfig.Free;
end; end;
// check Package Name // check Package Name
if (Result.Name='') or (not LazIsValidIdent(Result.Name,true,false)) then begin if (Result.Name='') or not IsValidPkgName(Result.Name) then
Error(ErrorPackageNameInvalid, Error(ErrorPackageNameInvalid,
Format(lisPkgMangThePackageNameOfTheFileIsInvalid, Format(lisPkgMangThePackageNameOfTheFileIsInvalid,
[Result.Name, LineEnding, Result.Filename])); [Result.Name, LineEnding, Result.Filename]));
end;
// check if Package with same name is already loaded // check if Package with same name is already loaded
ConflictPkg:=PackageGraph.FindPackageWithName(Result.Name,nil); ConflictPkg:=PackageGraph.FindPackageWithName(Result.Name,nil);
if ConflictPkg<>nil then begin if ConflictPkg<>nil then begin
@ -1051,7 +1049,7 @@ begin
PkgFilename:=''; PkgFilename:='';
if CompareFileExt(PackageNamesOrFiles[i],'.lpk')=0 then if CompareFileExt(PackageNamesOrFiles[i],'.lpk')=0 then
PkgFilename:=ExpandFileNameUTF8(PackageNamesOrFiles[i]) PkgFilename:=ExpandFileNameUTF8(PackageNamesOrFiles[i])
else if LazIsValidIdent(PackageNamesOrFiles[i]) then begin else if IsValidPkgName(PackageNamesOrFiles[i]) then begin
PackageLink:=TLazPackageLink(LazPackageLinks.FindLinkWithPkgName(PackageNamesOrFiles[i])); PackageLink:=TLazPackageLink(LazPackageLinks.FindLinkWithPkgName(PackageNamesOrFiles[i]));
if PackageLink=nil then if PackageLink=nil then
begin begin