fix, dub integration, a project that defines custom buildTypes was considered invalid

This commit is contained in:
Basile Burg 2015-11-06 08:19:08 +01:00
parent 53d3ed6527
commit 458839102d
1 changed files with 7 additions and 7 deletions

View File

@ -441,8 +441,10 @@ end;
procedure TCEDubProject.udpateConfigsFromJson;
var
i: integer;
dat: TJSONData;
arr: TJSONArray = nil;
item: TJSONObject = nil;
obj: TJSONObject = nil;
itemname: string;
begin
fBuildTypes.Clear;
@ -469,15 +471,13 @@ begin
end;
fBuildTypes.AddStrings(DubBuiltTypeName);
if fJSON.Find('buildTypes') <> nil then
dat := fJSON.Find('buildTypes');
if assigned(dat) and (dat.JSONType = jtObject) then
begin
arr := fJSON.Arrays['buildTypes'];
for i := 0 to arr.Count-1 do
obj := fJSON.Objects['buildTypes'];
for i := 0 to obj.Count-1 do
begin
item := TJSONObject(arr.Items[i]);
if item.Find('name') = nil then
continue;
itemname := item.Strings['name'];
itemname := obj.Names[i];
// defaults build types can be overridden
if fBuildTypes.IndexOf(itemname) <> -1 then
continue;