|
@@ -1673,7 +1673,6 @@ ResourceString
|
|
|
SWarnSkipPackageTargetProgress = '[%3.0f%%] Skipped package %s which has been disabled for target %s';
|
|
|
SWarnSkipPackageTarget = 'Skipped package %s which has been disabled for target %s';
|
|
|
SWarnInstallationPackagecomplete = 'Installation package %s for target %s succeeded';
|
|
|
- SWarnCleanPackagecomplete = 'Clean of package %s completed';
|
|
|
SWarnCanNotGetAccessRights = 'Warning: Failed to copy access-rights from file %s';
|
|
|
SWarnCanNotSetAccessRights = 'Warning: Failed to copy access-rights to file %s';
|
|
|
SWarnCanNotGetFileAge = 'Warning: Failed to get FileAge for %s';
|
|
@@ -1694,6 +1693,7 @@ ResourceString
|
|
|
SInfoUnInstallingPackage= 'Uninstalling package %s';
|
|
|
SInfoArchivingPackage = 'Archiving package %s in "%s"';
|
|
|
SInfoCleaningPackage = 'Cleaning package %s';
|
|
|
+ SInfoCleanPackagecomplete = 'Clean of package %s completed';
|
|
|
SInfoManifestPackage = 'Creating manifest for package %s';
|
|
|
SInfoPkgListPackage = 'Adding package %s to the package list';
|
|
|
SInfoCopyingFile = 'Copying file "%s" to "%s"';
|
|
@@ -1752,7 +1752,7 @@ ResourceString
|
|
|
SDbgDeletedFile = 'Recursively deleted file "%s"';
|
|
|
SDbgRemovedDirectory = 'Recursively removed directory "%s"';
|
|
|
SDbgUnregisteredResource = 'Adding resource file "%s", which is not registered.';
|
|
|
-
|
|
|
+ SDbgSearchingDir = 'Searching dir %s.';
|
|
|
|
|
|
// Help messages for usage
|
|
|
SValue = 'Value';
|
|
@@ -1785,6 +1785,7 @@ ResourceString
|
|
|
SHelpConfig = 'Use indicated config file when compiling.';
|
|
|
SHelpOptions = 'Pass extra options to the compiler.';
|
|
|
SHelpVerbose = 'Be verbose when working.';
|
|
|
+ SHelpDebug = 'Add debug information when working.';
|
|
|
SHelpInteractive = 'Allow to interact with child processes';
|
|
|
SHelpInstExamples = 'Install the example-sources.';
|
|
|
SHelpSkipCrossProgs = 'Skip programs when cross-compiling/installing';
|
|
@@ -2538,7 +2539,8 @@ procedure SearchFiles(AFileName, ASearchPathPrefix: string; Recursive: boolean;
|
|
|
var
|
|
|
Info : TSearchRec;
|
|
|
begin
|
|
|
- Writeln('Searching ',Searchdir);
|
|
|
+ if assigned(Installer) then
|
|
|
+ Installer.Log(VlDebug,Format(SDbgSearchingDir,[SearchDir]));
|
|
|
if FindFirst(SearchDir+AllFilesMask,faAnyFile and faDirectory,Info)=0 then
|
|
|
begin
|
|
|
repeat
|
|
@@ -3739,6 +3741,7 @@ begin
|
|
|
OB:=IncludeTrailingPathDelimiter(GetBinOutputDir(ACPU,AOS));
|
|
|
OU:=IncludeTrailingPathDelimiter(GetUnitsOutputDir(ACPU,AOS));
|
|
|
List.Add(GetUnitConfigOutputFilename(Defaults.CPU,Defaults.OS));
|
|
|
+ List.Add(ManifestFile);
|
|
|
AddConditionalStrings(Self, List,CleanFiles,ACPU,AOS);
|
|
|
For I:=0 to FTargets.Count-1 do
|
|
|
FTargets.TargetItems[I].GetCleanFiles(List, OU, OB, ACPU, AOS);
|
|
@@ -5288,7 +5291,7 @@ begin
|
|
|
Defaults.BuildMode:=bmBuildUnit
|
|
|
else if CheckOption(I,'io','ignoreinvalidoption', true) then
|
|
|
Defaults.IgnoreInvalidOptions:=true
|
|
|
- else if CheckOption(I,'d','doc-folder') then
|
|
|
+ else if CheckOption(I,'df','doc-folder') then
|
|
|
Defaults.FPDocOutputDir:=OptionArg(I)
|
|
|
else if CheckOption(I,'fsp','fpunitsrcpath') then
|
|
|
Defaults.FPUnitSourcePath:=OptionArg(I)
|
|
@@ -5354,6 +5357,7 @@ begin
|
|
|
LogOption('l','list-commands',SHelpList);
|
|
|
LogOption('n','nofpccfg',SHelpNoFPCCfg);
|
|
|
LogOption('v','verbose',SHelpVerbose);
|
|
|
+ LogOption('d','debug',SHelpDebug);
|
|
|
LogOption('I','interactive',SHelpInteractive);
|
|
|
{$ifdef HAS_UNIT_PROCESS}
|
|
|
LogOption('e', 'useenv', sHelpUseEnvironment);
|
|
@@ -5376,7 +5380,7 @@ begin
|
|
|
LogArgOption('r','compiler',SHelpCompiler);
|
|
|
LogArgOption('f','config',SHelpConfig);
|
|
|
LogArgOption('o','options',SHelpOptions);
|
|
|
- LogArgOption('d', 'doc-folder', sHelpFpdocOutputDir);
|
|
|
+ LogArgOption('df', 'doc-folder', sHelpFpdocOutputDir);
|
|
|
LogArgOption('fsp', 'fpunitsrcpath', sHelpFPUnitSrcPath);
|
|
|
LogArgOption('zp', 'zipprefix', sHelpZipPrefix);
|
|
|
{$ifndef NO_THREADING}
|
|
@@ -7937,14 +7941,20 @@ var
|
|
|
AOS: TOS;
|
|
|
DirectoryList : TStringList;
|
|
|
begin
|
|
|
+ if not AllTargets and (not(Defaults.OS in APackage.OSes) or
|
|
|
+ not (Defaults.CPU in APackage.CPUs)) then
|
|
|
+ exit;
|
|
|
Log(vlInfo,SInfoCleaningPackage,[APackage.Name]);
|
|
|
try
|
|
|
If (APackage.Directory<>'') then
|
|
|
EnterDir(APackage.Directory);
|
|
|
// Check for inherited options (packagevariants) from other packages
|
|
|
- ResolveDependencies(APackage.Dependencies, (APackage.Collection as TPackages));
|
|
|
- CheckDependencies(APackage, False);
|
|
|
- APackage.SetDefaultPackageVariant;
|
|
|
+ if (Defaults.OS in APackage.OSes) and (Defaults.CPU in APackage.CPUs) then
|
|
|
+ begin
|
|
|
+ ResolveDependencies(APackage.Dependencies, (APackage.Collection as TPackages));
|
|
|
+ CheckDependencies(APackage, False);
|
|
|
+ APackage.SetDefaultPackageVariant;
|
|
|
+ end;
|
|
|
DoBeforeClean(Apackage);
|
|
|
AddPackageMacrosToDictionary(APackage, APackage.Dictionary);
|
|
|
if AllTargets then
|
|
@@ -7956,7 +7966,8 @@ begin
|
|
|
for ACPU:=low(TCpu) to high(TCpu) do if ACPU<>cpuNone then
|
|
|
for AOS:=low(TOS) to high(TOS) do if AOS<>osNone then
|
|
|
begin
|
|
|
- if OSCPUSupported[AOS,ACPU] then
|
|
|
+ if OSCPUSupported[AOS,ACPU] and (AOS in APackage.OSes) and
|
|
|
+ (ACPU in APackage.CPUs) then
|
|
|
begin
|
|
|
// First perform a normal clean, to be sure that all files
|
|
|
// which are not in the units- or bin-dir are cleaned. (like
|
|
@@ -7975,6 +7986,7 @@ begin
|
|
|
Clean(APackage, Defaults.CPU, Defaults.OS);
|
|
|
DoAfterClean(Apackage);
|
|
|
Finally
|
|
|
+ log(vlInfo, SInfoCleanPackagecomplete, [APackage.Name]);
|
|
|
If (APackage.Directory<>'') then
|
|
|
EnterDir('');
|
|
|
end;
|
|
@@ -7984,6 +7996,8 @@ procedure TBuildEngine.Clean(APackage: TPackage; ACPU: TCPU; AOS: TOS);
|
|
|
Var
|
|
|
List : TStringList;
|
|
|
DirectoryList : TStringList;
|
|
|
+ RemainingList : TStrings;
|
|
|
+ i : longint;
|
|
|
begin
|
|
|
List:=TStringList.Create;
|
|
|
try
|
|
@@ -8012,6 +8026,11 @@ begin
|
|
|
begin
|
|
|
Installer.Log(vlWarning,Format(SWarnRemovedNonEmptyDirectory,[APackage.Directory+APackage.GetBinOutputDir(ACPU,AOS)]));
|
|
|
DirectoryList.Add(APackage.GetBinOutputDir(ACPU,AOS));
|
|
|
+ RemainingList := TStringList.Create;
|
|
|
+ SearchFiles(AllFilesMask, APackage.GetBinOutputDir(ACPU,AOS), true, RemainingList);
|
|
|
+ for i:=0 to RemainingList.Count-1 do
|
|
|
+ Installer.log(vlDebug,format('File %s still present',[RemainingList[i]]));
|
|
|
+ RemainingList.Free;
|
|
|
CmdRemoveTrees(DirectoryList);
|
|
|
DirectoryList.Clear;
|
|
|
end;
|
|
@@ -8020,6 +8039,11 @@ begin
|
|
|
begin
|
|
|
Installer.Log(vlWarning,Format(SWarnRemovedNonEmptyDirectory,[APackage.Directory+APackage.GetUnitsOutputDir(ACPU,AOS)]));
|
|
|
DirectoryList.Add(APackage.GetUnitsOutputDir(ACPU,AOS));
|
|
|
+ RemainingList := TStringList.Create;
|
|
|
+ SearchFiles(AllFilesMask, APackage.GetUnitsOutputDir(ACPU,AOS), true, RemainingList);
|
|
|
+ for i:=0 to RemainingList.Count-1 do
|
|
|
+ Installer.log(vlDebug,format('File %s still present',[RemainingList[i]]));
|
|
|
+ RemainingList.Free;
|
|
|
CmdRemoveTrees(DirectoryList);
|
|
|
DirectoryList.Clear;
|
|
|
end;
|
|
@@ -8374,7 +8398,6 @@ begin
|
|
|
P:=Packages.PackageItems[i];
|
|
|
If AllTargets or PackageOK(P) then
|
|
|
Clean(P, AllTargets);
|
|
|
- log(vlWarning, SWarnCleanPackagecomplete, [P.Name]);
|
|
|
end;
|
|
|
NotifyEventCollection.CallEvents(neaAfterClean, Self);
|
|
|
end;
|