lazbuild: added option --skip-dependencies

git-svn-id: trunk@9826 -
This commit is contained in:
mattias 2006-09-07 00:53:04 +00:00
parent fc1679300f
commit 15c69600cf

View File

@ -49,6 +49,7 @@ type
private
FBuildAll: boolean;
FBuildRecursive: boolean;
FSkipDependencies: boolean;
fInitialized: boolean;
fInitResult: boolean;
// external tools
@ -111,6 +112,8 @@ type
property BuildAll: boolean read FBuildAll write FBuildAll;// build all files of project/package
property BuildRecursive: boolean read FBuildRecursive // apply BuildAll flag to dependencies
write FBuildRecursive;
property SkipDependencies: boolean read FSkipDependencies
write FSkipDependencies;
end;
var
@ -293,6 +296,8 @@ begin
Include(Flags,pcfOnlyIfNeeded);
if BuildRecursive and BuildAll then
Include(Flags,pcfCompileDependenciesClean);
if SkipDependencies then
Include(Flags,pcfDoNotCompileDependencies);
CompilePackage(APackage,Flags);
Result:=true;
@ -402,7 +407,6 @@ end;
function TLazBuildApplication.BuildProject(const AFilename: string): boolean;
var
PkgFlags: TPkgCompileFlags;
CompilerFilename: String;
WorkingDir: String;
SrcFilename: String;
@ -420,6 +424,7 @@ begin
if Project1.MainUnitInfo=nil then
Error(ErrorBuildFailed,'project has no main unit');
if not SkipDependencies then begin
// compile required packages
CheckPackageGraphForCompilation(nil,Project1.FirstRequiredDependency);
@ -435,6 +440,7 @@ begin
finally
PackageGraph.EndUpdate;
end;
end;
WorkingDir:=Project1.ProjectDirectory;
SrcFilename:=CreateRelativePath(Project1.MainUnitInfo.Filename,WorkingDir);
@ -809,7 +815,8 @@ begin
LongOptions.Add('language');
LongOptions.Add('build-all');
LongOptions.Add('recursive');
ErrorMsg:=RepairedCheckOptions('lBR',LongOptions,Options,NonOptions);
LongOptions.Add('skip-dependencies');
ErrorMsg:=RepairedCheckOptions('lBrd',LongOptions,Options,NonOptions);
if ErrorMsg<>'' then begin
writeln(ErrorMsg);
writeln('');
@ -839,8 +846,10 @@ begin
// build all
if HasOption('B','build-all') then
BuildAll:=true;
if HasOption('R','recursive') then
if HasOption('r','recursive') then
BuildRecursive:=true;
if HasOption('d','skip-dependencies') then
SkipDependencies:=true;
finally
Options.Free;
NonOptions.Free;
@ -862,7 +871,8 @@ begin
writeln('--help or -? ', listhisHelpMessage);
writeln('');
writeln('-B or --build-all ','build all files of project/package');
writeln('-R or --recursive ','apply build flags (-B) to dependencies too.');
writeln('-r or --recursive ','apply build flags (-B) to dependencies too.');
writeln('-d or --skip-dependencies ','do not compile dependencies');
writeln('');
writeln(PrimaryConfPathOptLong,' <path>');
writeln('or ',PrimaryConfPathOptShort,' <path>');