|
@@ -126,6 +126,8 @@ Type
|
|
procedure SetPrefix(AValue: string);
|
|
procedure SetPrefix(AValue: string);
|
|
procedure SetRepositoryName(AValue: string);
|
|
procedure SetRepositoryName(AValue: string);
|
|
procedure SetPath(AValue: string);
|
|
procedure SetPath(AValue: string);
|
|
|
|
+ protected
|
|
|
|
+ procedure SaveToStrings(AStrings: TStrings); override;
|
|
public
|
|
public
|
|
procedure AddKeyValue(const AKey, AValue: string); override;
|
|
procedure AddKeyValue(const AKey, AValue: string); override;
|
|
procedure LogValues(ALogLevel: TLogLevel); override;
|
|
procedure LogValues(ALogLevel: TLogLevel); override;
|
|
@@ -202,6 +204,8 @@ Type
|
|
|
|
|
|
procedure BindToCompilerOptions(ACompilerOptions: TCompilerOptions);
|
|
procedure BindToCompilerOptions(ACompilerOptions: TCompilerOptions);
|
|
procedure AddRepositoriesForCompilerSettings(ACompilerOptions: TCompilerOptions);
|
|
procedure AddRepositoriesForCompilerSettings(ACompilerOptions: TCompilerOptions);
|
|
|
|
+ function AddRepositoryOptionSection(ASectionClass: TFppkgRepositoryOptionSectionClass): TFppkgRepositoryOptionSection;
|
|
|
|
+ function AddIncludeFilesOptionSection(AFileMask: string): TFppkgIncludeFilesOptionSection;
|
|
|
|
|
|
property SectionList: TFppkgOptionSectionList read GetSectionList;
|
|
property SectionList: TFppkgOptionSectionList read GetSectionList;
|
|
property GlobalSection: TFppkgGLobalOptionSection read GetGlobalSection;
|
|
property GlobalSection: TFppkgGLobalOptionSection read GetGlobalSection;
|
|
@@ -437,6 +441,18 @@ begin
|
|
FPath := fpmkunit.FixPath(AValue, True);
|
|
FPath := fpmkunit.FixPath(AValue, True);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TFppkgRepositoryOptionSection.SaveToStrings(AStrings: TStrings);
|
|
|
|
+begin
|
|
|
|
+ inherited SaveToStrings(AStrings);
|
|
|
|
+ AStrings.Add('['+KeyRepositorySection+']');
|
|
|
|
+ AStrings.Add(KeyRepositoryName+'='+RepositoryName);
|
|
|
|
+ AStrings.Add(KeyRepositoryDescription+'='+Description);
|
|
|
|
+ AStrings.Add(KeyRepositoryPath+'='+FPath);
|
|
|
|
+ AStrings.Add(KeyRepositoryPrefix+'='+FPrefix);
|
|
|
|
+ if InstallRepositoryName<>'' then
|
|
|
|
+ AStrings.Add(KeyInstallRepositoryName+'='+InstallRepositoryName);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TFppkgRepositoryOptionSection.AddKeyValue(const AKey, AValue: string);
|
|
procedure TFppkgRepositoryOptionSection.AddKeyValue(const AKey, AValue: string);
|
|
begin
|
|
begin
|
|
if SameText(AKey,KeyRepositoryName) then
|
|
if SameText(AKey,KeyRepositoryName) then
|
|
@@ -827,12 +843,24 @@ procedure TFppkgOptions.SaveToFile(const AFileName: string);
|
|
var
|
|
var
|
|
IniFile: TStringList;
|
|
IniFile: TStringList;
|
|
CurrentSection: TFppkgOptionSection;
|
|
CurrentSection: TFppkgOptionSection;
|
|
|
|
+ GSection: TFppkgGlobalOptionSection;
|
|
|
|
+ i: Integer;
|
|
begin
|
|
begin
|
|
IniFile:=TStringList.Create;
|
|
IniFile:=TStringList.Create;
|
|
try
|
|
try
|
|
- // Only the Global-section is being written, with some default values
|
|
|
|
- CurrentSection := GlobalSection;
|
|
|
|
- CurrentSection.SaveToStrings(IniFile);
|
|
|
|
|
|
+ GSection := GlobalSection;
|
|
|
|
+ GSection.SaveToStrings(IniFile);
|
|
|
|
+
|
|
|
|
+ for i := 0 to SectionList.Count-1 do
|
|
|
|
+ begin
|
|
|
|
+ CurrentSection := SectionList[i];
|
|
|
|
+ if CurrentSection<>GSection then
|
|
|
|
+ begin
|
|
|
|
+ IniFile.Add('');
|
|
|
|
+ CurrentSection.SaveToStrings(IniFile);
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+
|
|
Inifile.SaveToFile(AFileName);
|
|
Inifile.SaveToFile(AFileName);
|
|
finally
|
|
finally
|
|
Inifile.Free;
|
|
Inifile.Free;
|
|
@@ -898,6 +926,18 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TFppkgOptions.AddRepositoryOptionSection(ASectionClass: TFppkgRepositoryOptionSectionClass): TFppkgRepositoryOptionSection;
|
|
|
|
+begin
|
|
|
|
+ Result := ASectionClass.Create(FOptionParser);
|
|
|
|
+ FSectionList.Add(Result);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TFppkgOptions.AddIncludeFilesOptionSection(AFileMask: string): TFppkgIncludeFilesOptionSection;
|
|
|
|
+begin
|
|
|
|
+ Result := TFppkgIncludeFilesOptionSection.Create(FOptionParser, Self, AFileMask);
|
|
|
|
+ FSectionList.Add(Result);
|
|
|
|
+end;
|
|
|
|
+
|
|
{*****************************************************************************
|
|
{*****************************************************************************
|
|
TCompilerOptions
|
|
TCompilerOptions
|
|
*****************************************************************************}
|
|
*****************************************************************************}
|