LazBuild: Allow dotted file and package names.

git-svn-id: trunk@55747 -
This commit is contained in:
juha 2017-08-26 21:57:07 +00:00
parent 56d952d15c
commit b5cc5adcef

View File

@ -40,9 +40,9 @@ uses
// LazUtils // LazUtils
Masks, LConvEncoding, Laz2_XMLCfg, FileUtil, LazFileUtils, LazUTF8, Masks, LConvEncoding, Laz2_XMLCfg, FileUtil, LazFileUtils, LazUTF8,
// IDE // IDE
IDEProcs, InitialSetupProc, ExtTools, CompilerOptions, ApplicationBundle, IDEProcs, IDEUtils, InitialSetupProc, ExtTools, CompilerOptions,
TransferMacros, EnvironmentOpts, IDETranslations, LazarusIDEStrConsts, ApplicationBundle, TransferMacros, EnvironmentOpts, IDETranslations,
IDECmdLine, MiscOptions, Project, LazConf, PackageDefs, LazarusIDEStrConsts, IDECmdLine, MiscOptions, Project, LazConf, PackageDefs,
PackageLinks, PackageSystem, InterPkgConflictFiles, BuildLazDialog, PackageLinks, PackageSystem, InterPkgConflictFiles, BuildLazDialog,
BuildProfileManager, BuildManager, BaseBuildManager, ModeMatrixOpts; BuildProfileManager, BuildManager, BaseBuildManager, ModeMatrixOpts;
@ -232,8 +232,7 @@ begin
DepOwner:=Dependency.Owner; DepOwner:=Dependency.Owner;
if (DepOwner<>nil) then begin if (DepOwner<>nil) then begin
if DepOwner is TLazPackage then begin if DepOwner is TLazPackage then begin
Description:=Format(lisPkgMangPackage, [TLazPackage(DepOwner).IDAsString] Description:=Format(lisPkgMangPackage, [TLazPackage(DepOwner).IDAsString]);
);
end else if DepOwner is TProject then begin end else if DepOwner is TProject then begin
Description:=Format(lisPkgMangProject, Description:=Format(lisPkgMangProject,
[ExtractFileNameOnly(TProject(DepOwner).ProjectInfoFile)]); [ExtractFileNameOnly(TProject(DepOwner).ProjectInfoFile)]);
@ -241,8 +240,7 @@ begin
Description:=dbgsName(DepOwner) Description:=dbgsName(DepOwner)
end; end;
end else begin end else begin
Description:=Format(lisPkgMangDependencyWithoutOwner, [Dependency.AsString] Description:=Format(lisPkgMangDependencyWithoutOwner, [Dependency.AsString]);
);
end; end;
end; end;
@ -373,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 IsValidIdent(OriginalFileName) then begin if LazIsValidIdent(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;
@ -488,7 +486,7 @@ begin
XMLConfig.Free; XMLConfig.Free;
end; end;
// check Package Name // check Package Name
if (Result.Name='') or (not IsValidIdent(Result.Name)) then begin if (Result.Name='') or (not LazIsValidIdent(Result.Name)) then begin
Error(ErrorPackageNameInvalid, Error(ErrorPackageNameInvalid,
Format(lisPkgMangThePackageNameOfTheFileIsInvalid, Format(lisPkgMangThePackageNameOfTheFileIsInvalid,
[Result.Name, LineEnding, Result.Filename])); [Result.Name, LineEnding, Result.Filename]));
@ -819,8 +817,7 @@ var
end; end;
// execute compilation tool 'Before' // execute compilation tool 'Before'
ToolBefore:=TProjectCompilationToolOptions( ToolBefore:=TProjectCompilationToolOptions(Project1.CompilerOptions.ExecuteBefore);
Project1.CompilerOptions.ExecuteBefore);
if (CompReason in ToolBefore.CompileReasons) then begin if (CompReason in ToolBefore.CompileReasons) then begin
if ToolBefore.Execute(Project1.Directory, if ToolBefore.Execute(Project1.Directory,
lisProject2+lisExecutingCommandBefore, CompileHint)<>mrOk lisProject2+lisExecutingCommandBefore, CompileHint)<>mrOk
@ -1036,7 +1033,7 @@ var
i: integer; i: integer;
Package: TLazPackage; Package: TLazPackage;
PackageLink: TLazPackageLink; PackageLink: TLazPackageLink;
PackageName:string; PackageName: String;
PkgFilename: String; PkgFilename: String;
ErrorMsg: String; ErrorMsg: String;
ErrCode: Byte; ErrCode: Byte;
@ -1055,7 +1052,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 IsValidIdent(PackageNamesOrFiles[i]) then begin else if LazIsValidIdent(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