mirror of https://gitlab.com/basile.b/dexed.git
fix, interpretation of how dub handle the configs & built types
- default only added if no user-defined - check for overridden built types
This commit is contained in:
parent
fa4e2b3cf8
commit
3a37d133a6
|
@ -126,13 +126,17 @@ var
|
||||||
builtTypes: TJSONArray = nil;
|
builtTypes: TJSONArray = nil;
|
||||||
configs: TJSONArray = nil;
|
configs: TJSONArray = nil;
|
||||||
item: TJSONObject = nil;
|
item: TJSONObject = nil;
|
||||||
|
itemname: string;
|
||||||
begin
|
begin
|
||||||
fBuildTypes.Clear;
|
fBuildTypes.Clear;
|
||||||
fConfigs.Clear;
|
fConfigs.Clear;
|
||||||
|
|
||||||
// configs: builtype0 - config0, builtype0 - config1, ... , builtype0 - configN
|
// configs: builtype0 - config0, builtype0 - config1, ... , builtype0 - configN
|
||||||
// builtype1 - config0, builtype1 - config1, ... , builtype1 - configN, etc
|
// builtype1 - config0, builtype1 - config1, ... , builtype1 - configN, etc
|
||||||
fConfigs.Add('(dub default)'); // default
|
|
||||||
|
|
||||||
|
//fConfigs.Add('(dub default)'); // default
|
||||||
|
|
||||||
if fJson.Find('configurations') <> nil then
|
if fJson.Find('configurations') <> nil then
|
||||||
begin
|
begin
|
||||||
configs := fJson.Arrays['configurations'];
|
configs := fJson.Arrays['configurations'];
|
||||||
|
@ -141,7 +145,13 @@ begin
|
||||||
item := TJSONObject(configs.Items[i]);
|
item := TJSONObject(configs.Items[i]);
|
||||||
fConfigs.Add(item.Strings['name']);
|
fConfigs.Add(item.Strings['name']);
|
||||||
end;
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
fConfigs.Add('(dub default)'); // default
|
||||||
|
// default = what dub set as 'application' or 'library'
|
||||||
|
// in the case a project will pass nothing to DUB: eg DUB --build=release
|
||||||
end;
|
end;
|
||||||
|
|
||||||
fBuildTypes.AddStrings(DubBuiltTypeName);
|
fBuildTypes.AddStrings(DubBuiltTypeName);
|
||||||
if fJson.Find('buildTypes') <> nil then
|
if fJson.Find('buildTypes') <> nil then
|
||||||
begin
|
begin
|
||||||
|
@ -149,7 +159,10 @@ begin
|
||||||
for i := 0 to builtTypes.Count-1 do
|
for i := 0 to builtTypes.Count-1 do
|
||||||
begin
|
begin
|
||||||
item := TJSONObject(builtTypes.Items[i]);
|
item := TJSONObject(builtTypes.Items[i]);
|
||||||
fBuildTypes.Add(item.Strings['name']);
|
itemname := item.Strings['name'];
|
||||||
|
// defaults build types can be overridden
|
||||||
|
if fBuildTypes.IndexOf(itemname) <> -1 then continue;
|
||||||
|
fBuildTypes.Add(itemname);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
fConfigsCount := fConfigs.Count * fBuildTypes.Count;
|
fConfigsCount := fConfigs.Count * fBuildTypes.Count;
|
||||||
|
|
Loading…
Reference in New Issue