mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 18:59:20 +02:00
implemented saving auto install packages
git-svn-id: trunk@4099 -
This commit is contained in:
parent
cc9654f73b
commit
b223d90480
@ -69,7 +69,7 @@ type
|
|||||||
FTargetDirectory: string;
|
FTargetDirectory: string;
|
||||||
fTargetOS: string;
|
fTargetOS: string;
|
||||||
fLCLPlatform: TLCLPlatform;
|
fLCLPlatform: TLCLPlatform;
|
||||||
fAutoInstallPackages: TStringList;
|
fStaticAutoInstallPackages: TStringList;
|
||||||
procedure SetTargetDirectory(const AValue: string);
|
procedure SetTargetDirectory(const AValue: string);
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
@ -89,7 +89,7 @@ type
|
|||||||
property ExtraOptions: string read fExtraOptions write fExtraOptions;
|
property ExtraOptions: string read fExtraOptions write fExtraOptions;
|
||||||
property TargetOS: string read fTargetOS write fTargetOS;
|
property TargetOS: string read fTargetOS write fTargetOS;
|
||||||
property LCLPlatform: TLCLPlatform read fLCLPlatform write fLCLPlatform;
|
property LCLPlatform: TLCLPlatform read fLCLPlatform write fLCLPlatform;
|
||||||
property AutoInstallPackages: TStringList read fAutoInstallPackages;
|
property StaticAutoInstallPackages: TStringList read fStaticAutoInstallPackages;
|
||||||
property TargetDirectory: string read FTargetDirectory write SetTargetDirectory;
|
property TargetDirectory: string read FTargetDirectory write SetTargetDirectory;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -703,7 +703,7 @@ procedure TBuildLazarusOptions.Save(XMLConfig: TXMLConfig; const Path: string);
|
|||||||
begin
|
begin
|
||||||
XMLConfig.SetDeleteValue(Path+'BuildLCL/Value',
|
XMLConfig.SetDeleteValue(Path+'BuildLCL/Value',
|
||||||
MakeModeNames[fBuildLCL],
|
MakeModeNames[fBuildLCL],
|
||||||
MakeModeNames[mmNone]);
|
MakeModeNames[mmBuild]);
|
||||||
XMLConfig.SetDeleteValue(Path+'BuildComponents/Value',
|
XMLConfig.SetDeleteValue(Path+'BuildComponents/Value',
|
||||||
MakeModeNames[fBuildComponents],
|
MakeModeNames[fBuildComponents],
|
||||||
MakeModeNames[mmBuild]);
|
MakeModeNames[mmBuild]);
|
||||||
@ -732,7 +732,8 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(Path+'TargetDirectory/Value',
|
XMLConfig.SetDeleteValue(Path+'TargetDirectory/Value',
|
||||||
FTargetDirectory,DefaultTargetDirectory);
|
FTargetDirectory,DefaultTargetDirectory);
|
||||||
// auto install packages
|
// auto install packages
|
||||||
SaveStringList(XMLConfig,fAutoInstallPackages,Path+'AutoInstallPackages/');
|
SaveStringList(XMLConfig,fStaticAutoInstallPackages,
|
||||||
|
Path+'StaticAutoInstallPackages/');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildLazarusOptions.Load(XMLConfig: TXMLConfig; const Path: string);
|
procedure TBuildLazarusOptions.Load(XMLConfig: TXMLConfig; const Path: string);
|
||||||
@ -762,7 +763,8 @@ begin
|
|||||||
DefaultTargetDirectory)));
|
DefaultTargetDirectory)));
|
||||||
|
|
||||||
// auto install packages
|
// auto install packages
|
||||||
LoadStringList(XMLConfig,fAutoInstallPackages,Path+'AutoInstallPackages/');
|
LoadStringList(XMLConfig,fStaticAutoInstallPackages,
|
||||||
|
Path+'StaticAutoInstallPackages/');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildLazarusOptions.SetTargetDirectory(const AValue: string);
|
procedure TBuildLazarusOptions.SetTargetDirectory(const AValue: string);
|
||||||
@ -789,12 +791,12 @@ begin
|
|||||||
fLCLPlatform:=lpGtk;
|
fLCLPlatform:=lpGtk;
|
||||||
|
|
||||||
// auto install packages
|
// auto install packages
|
||||||
fAutoInstallPackages:=TStringList.Create;
|
fStaticAutoInstallPackages:=TStringList.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TBuildLazarusOptions.Destroy;
|
destructor TBuildLazarusOptions.Destroy;
|
||||||
begin
|
begin
|
||||||
fAutoInstallPackages.Free;
|
fStaticAutoInstallPackages.Free;
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1878,7 +1878,7 @@ Processor specific options:
|
|||||||
else
|
else
|
||||||
CurOutputDir:='';
|
CurOutputDir:='';
|
||||||
if CurOutputDir<>'' then
|
if CurOutputDir<>'' then
|
||||||
switches := switches + ' '+PrepareCmdLineOption('-FU'+CurOutputDir);
|
switches := switches + ' '+PrepareCmdLineOption('-FE'+CurOutputDir);
|
||||||
|
|
||||||
{ TODO: Implement the following switches. They need to be added
|
{ TODO: Implement the following switches. They need to be added
|
||||||
to the dialog. }
|
to the dialog. }
|
||||||
@ -4082,7 +4082,9 @@ begin
|
|||||||
'$(LazarusDir)/lcl/units'
|
'$(LazarusDir)/lcl/units'
|
||||||
+';$(LazarusDir)/lcl/units/$(LCLWidgetType)'
|
+';$(LazarusDir)/lcl/units/$(LCLWidgetType)'
|
||||||
+';$(LazarusDir)/components/units'
|
+';$(LazarusDir)/components/units'
|
||||||
+';$(LazarusDir)/components/custom';
|
+';$(LazarusDir)/components/custom'
|
||||||
|
+';$(LazarusDir)/packager/units'
|
||||||
|
;
|
||||||
end else
|
end else
|
||||||
if AButton=IncludeFilesPathEditBtn then begin
|
if AButton=IncludeFilesPathEditBtn then begin
|
||||||
OldPath:=edtIncludeFiles.Text;
|
OldPath:=edtIncludeFiles.Text;
|
||||||
@ -4094,7 +4096,8 @@ begin
|
|||||||
'$(LazarusDir)/lcl'
|
'$(LazarusDir)/lcl'
|
||||||
+';$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)'
|
+';$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)'
|
||||||
+';$(LazarusDir)/components/synedit'
|
+';$(LazarusDir)/components/synedit'
|
||||||
+';$(LazarusDir)/components/codetools');
|
+';$(LazarusDir)/components/codetools'
|
||||||
|
);
|
||||||
end else
|
end else
|
||||||
if AButton=LibrariesPathEditBtn then begin
|
if AButton=LibrariesPathEditBtn then begin
|
||||||
OldPath:=edtLibraries.Text;
|
OldPath:=edtLibraries.Text;
|
||||||
|
@ -506,6 +506,7 @@ type
|
|||||||
function GetCompileSourceFilename: string;
|
function GetCompileSourceFilename: string;
|
||||||
function GetOutputDirectory: string;
|
function GetOutputDirectory: string;
|
||||||
function GetStateFilename: string;
|
function GetStateFilename: string;
|
||||||
|
function GetSrcFilename: string;
|
||||||
function GetCompilerFilename: string;
|
function GetCompilerFilename: string;
|
||||||
function GetUnitPath(RelativeToBaseDir: boolean): string;
|
function GetUnitPath(RelativeToBaseDir: boolean): string;
|
||||||
function GetIncludePath(RelativeToBaseDir: boolean): string;
|
function GetIncludePath(RelativeToBaseDir: boolean): string;
|
||||||
@ -612,7 +613,7 @@ type
|
|||||||
|
|
||||||
const
|
const
|
||||||
LazPkgXMLFileVersion = 1;
|
LazPkgXMLFileVersion = 1;
|
||||||
|
|
||||||
PkgFileTypeNames: array[TPkgFileType] of string = (
|
PkgFileTypeNames: array[TPkgFileType] of string = (
|
||||||
'pftUnit', 'pftLFM', 'pftLRS', 'pftInclude', 'pftText', 'pftBinary');
|
'pftUnit', 'pftLFM', 'pftLRS', 'pftInclude', 'pftText', 'pftBinary');
|
||||||
PkgFileTypeIdents: array[TPkgFileType] of string = (
|
PkgFileTypeIdents: array[TPkgFileType] of string = (
|
||||||
@ -2302,6 +2303,11 @@ begin
|
|||||||
+ChangeFileExt(GetCompileSourceFilename,'.compiled');
|
+ChangeFileExt(GetCompileSourceFilename,'.compiled');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TLazPackage.GetSrcFilename: string;
|
||||||
|
begin
|
||||||
|
Result:=FDirectory+GetCompileSourceFilename;
|
||||||
|
end;
|
||||||
|
|
||||||
function TLazPackage.GetCompilerFilename: string;
|
function TLazPackage.GetCompilerFilename: string;
|
||||||
begin
|
begin
|
||||||
Result:=CompilerOptions.ParsedOpts.GetParsedValue(pcosCompilerPath);
|
Result:=CompilerOptions.ParsedOpts.GetParsedValue(pcosCompilerPath);
|
||||||
|
@ -817,6 +817,10 @@ begin
|
|||||||
AddFile('inc/process.pp','Process',pftUnit,[pffHasRegisterProc],cpBase);
|
AddFile('inc/process.pp','Process',pftUnit,[pffHasRegisterProc],cpBase);
|
||||||
AddFile('db/db.pp','DB',pftUnit,[pffHasRegisterProc],cpBase);
|
AddFile('db/db.pp','DB',pftUnit,[pffHasRegisterProc],cpBase);
|
||||||
|
|
||||||
|
// use the packager/units/lazaruspackageintf.o file as indicator,
|
||||||
|
// if FCL has been recompiled
|
||||||
|
OutputStateFile:='$(LazarusDir)/packager/units/lazaruspackageintf.o';
|
||||||
|
|
||||||
Modified:=false;
|
Modified:=false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -105,7 +105,8 @@ type
|
|||||||
function DoLoadPackageCompiledState(APackage: TLazPackage;
|
function DoLoadPackageCompiledState(APackage: TLazPackage;
|
||||||
IgnoreErrors: boolean): TModalResult;
|
IgnoreErrors: boolean): TModalResult;
|
||||||
function CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
function CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
||||||
var NewCompilerFilename, NewCompilerParams: string): TModalResult;
|
const CompilerFilename, CompilerParams,
|
||||||
|
SrcFilename: string): TModalResult;
|
||||||
function MacroFunctionPkgSrcPath(Data: Pointer): boolean;
|
function MacroFunctionPkgSrcPath(Data: Pointer): boolean;
|
||||||
function MacroFunctionPkgUnitPath(Data: Pointer): boolean;
|
function MacroFunctionPkgUnitPath(Data: Pointer): boolean;
|
||||||
function MacroFunctionPkgIncPath(Data: Pointer): boolean;
|
function MacroFunctionPkgIncPath(Data: Pointer): boolean;
|
||||||
@ -116,6 +117,7 @@ type
|
|||||||
procedure LoadStaticBasePackages;
|
procedure LoadStaticBasePackages;
|
||||||
procedure LoadStaticCustomPackages;
|
procedure LoadStaticCustomPackages;
|
||||||
function LoadInstalledPackage(const PackageName: string): TLazPackage;
|
function LoadInstalledPackage(const PackageName: string): TLazPackage;
|
||||||
|
procedure LoadAutoInstallPackages;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -754,9 +756,11 @@ function TPkgManager.DoPreparePackageOutputDirectory(APackage: TLazPackage
|
|||||||
var
|
var
|
||||||
OutputDir: String;
|
OutputDir: String;
|
||||||
StateFile: String;
|
StateFile: String;
|
||||||
|
PkgSrcDir: String;
|
||||||
begin
|
begin
|
||||||
OutputDir:=APackage.GetOutputDirectory;
|
OutputDir:=APackage.GetOutputDirectory;
|
||||||
StateFile:=APackage.GetStateFilename;
|
StateFile:=APackage.GetStateFilename;
|
||||||
|
PkgSrcDir:=ExtractFilePath(APackage.GetSrcFilename);
|
||||||
|
|
||||||
// create the output directory
|
// create the output directory
|
||||||
if not ForceDirectory(OutputDir) then begin
|
if not ForceDirectory(OutputDir) then begin
|
||||||
@ -777,14 +781,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
APackage.Flags:=APackage.Flags-[lpfStateFileLoaded];
|
APackage.Flags:=APackage.Flags-[lpfStateFileLoaded];
|
||||||
|
|
||||||
|
// create the package src directory
|
||||||
|
if not ForceDirectory(PkgSrcDir) then begin
|
||||||
|
Result:=MessageDlg('Unable to create directory',
|
||||||
|
'Unable to create package source directory "'+PkgSrcDir+'"'#13
|
||||||
|
+'for package '+APackage.IDAsString+'.',
|
||||||
|
mtError,[mbCancel,mbAbort],0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgManager.CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
function TPkgManager.CheckIfPackageNeedsCompilation(APackage: TLazPackage;
|
||||||
var NewCompilerFilename, NewCompilerParams: string): TModalResult;
|
const CompilerFilename, CompilerParams, SrcFilename: string): TModalResult;
|
||||||
var
|
var
|
||||||
OutputDir: String;
|
|
||||||
SrcFilename: String;
|
|
||||||
StateFilename: String;
|
StateFilename: String;
|
||||||
StateFileAge: Integer;
|
StateFileAge: Integer;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -796,14 +807,6 @@ begin
|
|||||||
Result:=mrYes;
|
Result:=mrYes;
|
||||||
writeln('TPkgManager.CheckIfPackageNeedsCompilation A ',APackage.IDAsString);
|
writeln('TPkgManager.CheckIfPackageNeedsCompilation A ',APackage.IDAsString);
|
||||||
|
|
||||||
// calculate compiler filename and parameters
|
|
||||||
OutputDir:=APackage.GetOutputDirectory;
|
|
||||||
SrcFilename:=OutputDir+APackage.GetCompileSourceFilename;
|
|
||||||
NewCompilerFilename:=APackage.GetCompilerFilename;
|
|
||||||
NewCompilerParams:=APackage.CompilerOptions.MakeOptionsString(
|
|
||||||
APackage.CompilerOptions.DefaultMakeOptionsFlags)
|
|
||||||
+' '+CreateRelativePath(SrcFilename,APackage.Directory);
|
|
||||||
|
|
||||||
// check state file
|
// check state file
|
||||||
StateFilename:=APackage.GetStateFilename;
|
StateFilename:=APackage.GetStateFilename;
|
||||||
Result:=DoLoadPackageCompiledState(APackage,false);
|
Result:=DoLoadPackageCompiledState(APackage,false);
|
||||||
@ -856,33 +859,33 @@ begin
|
|||||||
Result:=mrYes;
|
Result:=mrYes;
|
||||||
|
|
||||||
// check main source file
|
// check main source file
|
||||||
if not FileExists(SrcFilename) or (StateFileAge<FileAge(SrcFilename)) then
|
if FileExists(SrcFilename) and (StateFileAge<FileAge(SrcFilename)) then
|
||||||
begin
|
begin
|
||||||
writeln('TPkgManager.CheckIfPackageNeedsCompilation SrcFile outdated ',APackage.IDAsString);
|
writeln('TPkgManager.CheckIfPackageNeedsCompilation SrcFile outdated ',APackage.IDAsString);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// check compiler and params
|
// check compiler and params
|
||||||
if NewCompilerFilename<>APackage.LastCompilerFilename then begin
|
if CompilerFilename<>APackage.LastCompilerFilename then begin
|
||||||
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler filename changed for ',APackage.IDAsString);
|
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler filename changed for ',APackage.IDAsString);
|
||||||
writeln(' Old="',APackage.LastCompilerFilename,'"');
|
writeln(' Old="',APackage.LastCompilerFilename,'"');
|
||||||
writeln(' Now="',NewCompilerFilename,'"');
|
writeln(' Now="',CompilerFilename,'"');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not FileExists(NewCompilerFilename) then begin
|
if not FileExists(CompilerFilename) then begin
|
||||||
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler filename not found for ',APackage.IDAsString);
|
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler filename not found for ',APackage.IDAsString);
|
||||||
writeln(' File="',NewCompilerFilename,'"');
|
writeln(' File="',CompilerFilename,'"');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if FileAge(NewCompilerFilename)<>APackage.LastCompilerFileDate then begin
|
if FileAge(CompilerFilename)<>APackage.LastCompilerFileDate then begin
|
||||||
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler file changed for ',APackage.IDAsString);
|
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler file changed for ',APackage.IDAsString);
|
||||||
writeln(' File="',NewCompilerFilename,'"');
|
writeln(' File="',CompilerFilename,'"');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if NewCompilerParams<>APackage.LastCompilerParams then begin
|
if CompilerParams<>APackage.LastCompilerParams then begin
|
||||||
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler params changed for ',APackage.IDAsString);
|
writeln('TPkgManager.CheckIfPackageNeedsCompilation Compiler params changed for ',APackage.IDAsString);
|
||||||
writeln(' Old="',APackage.LastCompilerParams,'"');
|
writeln(' Old="',APackage.LastCompilerParams,'"');
|
||||||
writeln(' Now="',NewCompilerParams,'"');
|
writeln(' Now="',CompilerParams,'"');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1002,10 +1005,13 @@ begin
|
|||||||
sl:=TStringList.Create;
|
sl:=TStringList.Create;
|
||||||
Dependency:=FirstAutoInstallDependency;
|
Dependency:=FirstAutoInstallDependency;
|
||||||
while Dependency<>nil do begin
|
while Dependency<>nil do begin
|
||||||
|
if (Dependency.LoadPackageResult<>lprSuccess)
|
||||||
|
or (Dependency.RequiredPackage.AutoCreated) then continue;
|
||||||
sl.Add(Dependency.PackageName);
|
sl.Add(Dependency.PackageName);
|
||||||
|
writeln('TPkgManager.SaveAutoInstallDependencies A ',Dependency.PackageName);
|
||||||
Dependency:=Dependency.NextRequiresDependency;
|
Dependency:=Dependency.NextRequiresDependency;
|
||||||
end;
|
end;
|
||||||
MiscellaneousOptions.BuildLazOpts.AutoInstallPackages.Assign(sl);
|
MiscellaneousOptions.BuildLazOpts.StaticAutoInstallPackages.Assign(sl);
|
||||||
sl.Free;
|
sl.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1080,6 +1086,35 @@ begin
|
|||||||
Result:=NewDependency.RequiredPackage;
|
Result:=NewDependency.RequiredPackage;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPkgManager.LoadAutoInstallPackages;
|
||||||
|
var
|
||||||
|
PkgList: TStringList;
|
||||||
|
i: Integer;
|
||||||
|
PackageName: string;
|
||||||
|
Dependency: TPkgDependency;
|
||||||
|
begin
|
||||||
|
PkgList:=MiscellaneousOptions.BuildLazOpts.StaticAutoInstallPackages;
|
||||||
|
for i:=0 to PkgList.Count-1 do begin
|
||||||
|
PackageName:=PkgList[i];
|
||||||
|
if (PackageName='') or (not IsValidIdent(PackageName)) then continue;
|
||||||
|
Dependency:=FindDependencyByNameInList(FirstAutoInstallDependency,
|
||||||
|
pdlRequires,PackageName);
|
||||||
|
if Dependency<>nil then continue;
|
||||||
|
Dependency:=TPkgDependency.Create;
|
||||||
|
Dependency.Owner:=Self;
|
||||||
|
Dependency.PackageName:=PackageName;
|
||||||
|
Dependency.AddToList(FirstAutoInstallDependency,pdlRequires);
|
||||||
|
if PackageGraph.OpenDependency(Dependency)<>lprSuccess then begin
|
||||||
|
MessageDlg('Unable to load package',
|
||||||
|
'Unable to open the package "'+PackageName+'".'#13
|
||||||
|
+'This package was marked for for installation.',
|
||||||
|
mtWarning,[mbOk],0);
|
||||||
|
continue;
|
||||||
|
end;
|
||||||
|
Dependency.RequiredPackage.AutoInstall:=pitStatic;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TPkgManager.Create(TheOwner: TComponent);
|
constructor TPkgManager.Create(TheOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
@ -1191,6 +1226,8 @@ begin
|
|||||||
LoadStaticBasePackages;
|
LoadStaticBasePackages;
|
||||||
LoadStaticCustomPackages;
|
LoadStaticCustomPackages;
|
||||||
IDEComponentPalette.EndUpdate;
|
IDEComponentPalette.EndUpdate;
|
||||||
|
|
||||||
|
LoadAutoInstallPackages;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPkgManager.UnloadInstalledPackages;
|
procedure TPkgManager.UnloadInstalledPackages;
|
||||||
@ -1614,6 +1651,7 @@ var
|
|||||||
CompilerFilename: String;
|
CompilerFilename: String;
|
||||||
CompilerParams: String;
|
CompilerParams: String;
|
||||||
EffektiveCompilerParams: String;
|
EffektiveCompilerParams: String;
|
||||||
|
SrcFilename: String;
|
||||||
begin
|
begin
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
|
|
||||||
@ -1641,10 +1679,17 @@ begin
|
|||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
SrcFilename:=APackage.GetSrcFilename;
|
||||||
|
CompilerFilename:=APackage.GetCompilerFilename;
|
||||||
|
CompilerParams:=APackage.CompilerOptions.MakeOptionsString(
|
||||||
|
APackage.CompilerOptions.DefaultMakeOptionsFlags)
|
||||||
|
+' '+CreateRelativePath(SrcFilename,APackage.Directory);
|
||||||
|
|
||||||
// check if compilation is neccessary
|
// check if compilation is neccessary
|
||||||
if ([pcfOnlyIfNeeded,pcfCleanCompile]*Flags<>[]) then begin
|
if ([pcfOnlyIfNeeded,pcfCleanCompile]*Flags<>[]) then begin
|
||||||
Result:=CheckIfPackageNeedsCompilation(APackage,
|
Result:=CheckIfPackageNeedsCompilation(APackage,
|
||||||
CompilerFilename,CompilerParams);
|
CompilerFilename,CompilerParams,
|
||||||
|
SrcFilename);
|
||||||
if Result=mrNo then begin
|
if Result=mrNo then begin
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
exit;
|
exit;
|
||||||
@ -1702,7 +1747,8 @@ begin
|
|||||||
SourceNotebook.ClearErrorLines;
|
SourceNotebook.ClearErrorLines;
|
||||||
|
|
||||||
// compile package
|
// compile package
|
||||||
Result:=EnvironmentOptions.ExternalTools.Run(PkgCompileTool,MainIDE.MacroList);
|
Result:=EnvironmentOptions.ExternalTools.Run(PkgCompileTool,
|
||||||
|
MainIDE.MacroList);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
// compilation succeded -> write state file
|
// compilation succeded -> write state file
|
||||||
Result:=DoSavePackageCompiledState(APackage,
|
Result:=DoSavePackageCompiledState(APackage,
|
||||||
@ -1749,11 +1795,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SrcFilename:=OutputDir+APackage.GetCompileSourceFilename;
|
SrcFilename:=APackage.GetSrcFilename;
|
||||||
|
|
||||||
// backup old file
|
|
||||||
Result:=MainIDE.DoBackupFile(SrcFilename,false);
|
|
||||||
if Result=mrAbort then exit;
|
|
||||||
|
|
||||||
// delete ambigious files
|
// delete ambigious files
|
||||||
Result:=MainIDE.DoDeleteAmbigiousFiles(SrcFilename);
|
Result:=MainIDE.DoDeleteAmbigiousFiles(SrcFilename);
|
||||||
|
Loading…
Reference in New Issue
Block a user