mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 19:19:18 +02:00
LazBuild: read pcp from lazarus.cfg file
git-svn-id: trunk@43687 -
This commit is contained in:
parent
11ed2bfba4
commit
1e3565dae3
@ -78,6 +78,7 @@ function GetCfgFileContent: TStrings;
|
|||||||
function GetParamsAndCfgFile: TStrings;
|
function GetParamsAndCfgFile: TStrings;
|
||||||
function ParamsAndCfgCount: Integer;
|
function ParamsAndCfgCount: Integer;
|
||||||
function ParamsAndCfgStr(Idx: Integer): String;
|
function ParamsAndCfgStr(Idx: Integer): String;
|
||||||
|
procedure ResetParamsAndCfg;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -153,6 +154,11 @@ begin
|
|||||||
Result := GetParamsAndCfgFile[Idx];
|
Result := GetParamsAndCfgFile[Idx];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure ResetParamsAndCfg;
|
||||||
|
begin
|
||||||
|
FreeAndNil(ParamsAndCfgFileContent);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure ParseCommandLine(aCmdLineParams: TStrings; out IDEPid: Integer; out
|
procedure ParseCommandLine(aCmdLineParams: TStrings; out IDEPid: Integer; out
|
||||||
ShowSplashScreen: boolean);
|
ShowSplashScreen: boolean);
|
||||||
const
|
const
|
||||||
|
@ -98,6 +98,9 @@ type
|
|||||||
{%H-}DlgType: TMsgDlgType; {%H-}Buttons: array of const;
|
{%H-}DlgType: TMsgDlgType; {%H-}Buttons: array of const;
|
||||||
const {%H-}HelpKeyword: string): Integer;
|
const {%H-}HelpKeyword: string): Integer;
|
||||||
protected
|
protected
|
||||||
|
function GetParams(Index: Integer): String; override;
|
||||||
|
function GetParamCount: Integer; override;
|
||||||
|
|
||||||
// Builds project or package, depending on extension.
|
// Builds project or package, depending on extension.
|
||||||
// Packages can also be specified by package name if they are known to the IDE.
|
// Packages can also be specified by package name if they are known to the IDE.
|
||||||
function BuildFile(Filename: string): boolean;
|
function BuildFile(Filename: string): boolean;
|
||||||
@ -177,6 +180,48 @@ const
|
|||||||
ErrorLoadProjectFailed = 5;
|
ErrorLoadProjectFailed = 5;
|
||||||
VersionStr = {$I version.inc};
|
VersionStr = {$I version.inc};
|
||||||
|
|
||||||
|
procedure FilterConfigFileContent;
|
||||||
|
var
|
||||||
|
l: TStrings;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
ResetParamsAndCfg;
|
||||||
|
l := GetCfgFileContent;
|
||||||
|
i := l.Count - 1;
|
||||||
|
while i >= 0 do begin
|
||||||
|
if not(
|
||||||
|
(copy(l[i], 1, 22) = '--primary-config-path=') or
|
||||||
|
(copy(l[i], 1, 24) = '--secondary-config-path=') or
|
||||||
|
(copy(l[i], 1, 6) = '--pcp=') or
|
||||||
|
(copy(l[i], 1, 6) = '--scp=')
|
||||||
|
)
|
||||||
|
then
|
||||||
|
l.Delete(i);
|
||||||
|
dec(i);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function ParamCount: Integer;
|
||||||
|
begin
|
||||||
|
Result := GetParamsAndCfgFile.Count - 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function Paramstr(Param : Integer) : Ansistring;
|
||||||
|
begin
|
||||||
|
if Param >= GetParamsAndCfgFile.Count then
|
||||||
|
Result := ''
|
||||||
|
else
|
||||||
|
Result := GetParamsAndCfgFile[Param];
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function ParamStrUTF8(Param : Integer) : Ansistring;
|
||||||
|
begin
|
||||||
|
if Param >= GetParamsAndCfgFile.Count then
|
||||||
|
Result := ''
|
||||||
|
else
|
||||||
|
Result := GetParamsAndCfgFile[Param];
|
||||||
|
end;
|
||||||
|
|
||||||
procedure GetDescriptionOfDependencyOwner(Dependency: TPkgDependency;
|
procedure GetDescriptionOfDependencyOwner(Dependency: TPkgDependency;
|
||||||
out Description: string);
|
out Description: string);
|
||||||
var
|
var
|
||||||
@ -314,6 +359,19 @@ begin
|
|||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TLazBuildApplication.GetParams(Index: Integer): String;
|
||||||
|
begin
|
||||||
|
if Index >= GetParamsAndCfgFile.Count then
|
||||||
|
Result := ''
|
||||||
|
else
|
||||||
|
Result := GetParamsAndCfgFile[Index];
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TLazBuildApplication.GetParamCount: Integer;
|
||||||
|
begin
|
||||||
|
Result := GetParamsAndCfgFile.Count - 1;
|
||||||
|
end;
|
||||||
|
|
||||||
function TLazBuildApplication.BuildFile(Filename: string): boolean;
|
function TLazBuildApplication.BuildFile(Filename: string): boolean;
|
||||||
var
|
var
|
||||||
OriginalFilename: string;
|
OriginalFilename: string;
|
||||||
@ -1618,6 +1676,7 @@ begin
|
|||||||
{$IFDEF BuildWidgetSetCocoa} Result:=lpCocoa; {$ENDIF}
|
{$IFDEF BuildWidgetSetCocoa} Result:=lpCocoa; {$ENDIF}
|
||||||
{$IFDEF BuildWidgetSetNoGui} Result:=lpNoGUI; {$ENDIF}
|
{$IFDEF BuildWidgetSetNoGui} Result:=lpNoGUI; {$ENDIF}
|
||||||
|
|
||||||
|
FilterConfigFileContent;
|
||||||
// free LCL application
|
// free LCL application
|
||||||
FreeAndNil(Forms.Application);
|
FreeAndNil(Forms.Application);
|
||||||
// start our own application
|
// start our own application
|
||||||
|
Loading…
Reference in New Issue
Block a user