project groups: load build mdoes from IDE project

git-svn-id: trunk@50432 -
This commit is contained in:
mattias 2015-11-20 09:09:06 +00:00
parent ead4658b86
commit 0d62cb6fed
3 changed files with 13 additions and 8 deletions

View File

@ -1074,6 +1074,7 @@ var
Pkg: TIDEPackage;
PkgName, Path, SubPath, CurFilename, BaseDir, BuildMode: String;
xml: TXMLConfig;
LazBuildMode: TLazProjectBuildMode;
begin
if FFiles<>nil then exit; // already loaded
@ -1108,6 +1109,10 @@ begin
end;
// ToDo: load buildmodes
for i:=0 to AProject.LazBuildModes.Count-1 do begin
LazBuildMode:=AProject.LazBuildModes.BuildModes[i];
FBuildModes.Add(TPGBuildMode.Create(Self,LazBuildMode.Identifier,false));
end;
end else begin
// load from .lpi file
@ -1184,7 +1189,7 @@ begin
for i:=1 to BuildModeCount do begin
SubPath:=aPath+'Mode'+IntToStr(i)+'/';
aMode:=BuildModes[i-1];
XMLConfig.SetDeleteValue(SubPath+'Name',aMode.Name,'');
XMLConfig.SetDeleteValue(SubPath+'Name',aMode.Identifier,'');
XMLConfig.SetDeleteValue(SubPath+'Compile',aMode.Compile,false);
end;
end;

View File

@ -1204,7 +1204,7 @@ begin
if T.BuildModeCount>1 then begin
BuildModeNode:=CreateSectionNode(AParent,lisNodeBuildModes,ntBuildModes);
for i:=0 to T.BuildModeCount-1 do
CreateSubNode(BuildModeNode,ntBuildMode,T,T.BuildModes[i].Name);
CreateSubNode(BuildModeNode,ntBuildMode,T,T.BuildModes[i].Identifier);
end;
// files
FileNodes[False]:=CreateSectionNode(AParent,lisNodeFiles,ntFiles);

View File

@ -43,13 +43,13 @@ Type
TPGBuildMode = class
private
FCompile: boolean;
FName: string;
FIdentifier: string;
FTarget: TPGCompileTarget;
procedure SetCompile(AValue: boolean);
public
constructor Create(aTarget: TPGCompileTarget; const aName: string; aCompile: boolean);
constructor Create(aTarget: TPGCompileTarget; const anIdentifier: string; aCompile: boolean);
property Target: TPGCompileTarget read FTarget;
property Name: string read FName;
property Identifier: string read FIdentifier;
property Compile: boolean read FCompile write SetCompile;
end;
@ -263,11 +263,11 @@ begin
Target.Modified;
end;
constructor TPGBuildMode.Create(aTarget: TPGCompileTarget; const aName: string;
constructor TPGBuildMode.Create(aTarget: TPGCompileTarget; const anIdentifier: string;
aCompile: boolean);
begin
FTarget:=aTarget;
FName:=aName;
FIdentifier:=anIdentifier;
FCompile:=aCompile;
end;
@ -575,7 +575,7 @@ end;
function TPGCompileTarget.IndexOfBuildMode(aName: string): integer;
begin
Result:=BuildModeCount-1;
while (Result>=0) and (CompareText(aName,BuildModes[Result].Name)<>0) do
while (Result>=0) and (CompareText(aName,BuildModes[Result].Identifier)<>0) do
dec(Result);
end;