mirror of https://gitlab.com/basile.b/dexed.git
more for #10, get output filename
This commit is contained in:
parent
ed3022016b
commit
845053b5e0
|
@ -27,6 +27,7 @@ type
|
||||||
fBinKind: TProjectBinaryKind;
|
fBinKind: TProjectBinaryKind;
|
||||||
fBasePath: string;
|
fBasePath: string;
|
||||||
fModificationCount: integer;
|
fModificationCount: integer;
|
||||||
|
fOutputFileName: string;
|
||||||
//
|
//
|
||||||
procedure doModified;
|
procedure doModified;
|
||||||
procedure updateFields;
|
procedure updateFields;
|
||||||
|
@ -35,6 +36,7 @@ type
|
||||||
procedure updateSourcesFromJson;
|
procedure updateSourcesFromJson;
|
||||||
procedure updateTargetKindFromJson;
|
procedure updateTargetKindFromJson;
|
||||||
procedure updateImportPathsFromJson;
|
procedure updateImportPathsFromJson;
|
||||||
|
procedure updateOutputNameFromJson;
|
||||||
function findTargetKindInd(value: TJSONObject): boolean;
|
function findTargetKindInd(value: TJSONObject): boolean;
|
||||||
procedure dubProcOutput(proc: TProcess);
|
procedure dubProcOutput(proc: TProcess);
|
||||||
function getCurrentCustomConfig: TJSONObject;
|
function getCurrentCustomConfig: TJSONObject;
|
||||||
|
@ -213,8 +215,7 @@ end;
|
||||||
|
|
||||||
function TCEDubProject.outputFilename: string;
|
function TCEDubProject.outputFilename: string;
|
||||||
begin
|
begin
|
||||||
//TODO-cDUB: implement outputFilename
|
exit(fOutputFileName);
|
||||||
exit('');
|
|
||||||
end;
|
end;
|
||||||
{$ENDREGION --------------------------------------------------------------------}
|
{$ENDREGION --------------------------------------------------------------------}
|
||||||
|
|
||||||
|
@ -604,6 +605,45 @@ begin
|
||||||
if assigned(conf) then addFrom(conf);
|
if assigned(conf) then addFrom(conf);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEDubProject.updateOutputNameFromJson;
|
||||||
|
procedure setFrom(obj: TJSONObject);
|
||||||
|
var
|
||||||
|
item: TJSONData;
|
||||||
|
begin
|
||||||
|
item := obj.Find('targetPath');
|
||||||
|
if assigned(item) then
|
||||||
|
fOutputFileName := item.AsString;
|
||||||
|
item := obj.Find('targetName');
|
||||||
|
if assigned(item) then
|
||||||
|
fOutputFileName += DirectorySeparator + item.AsString;
|
||||||
|
end;
|
||||||
|
var
|
||||||
|
conf: TJSONObject;
|
||||||
|
item: TJSONData;
|
||||||
|
begin
|
||||||
|
fOutputFileName := '';
|
||||||
|
setFrom(fJSON);
|
||||||
|
conf := getCurrentCustomConfig;
|
||||||
|
if assigned(conf) then setFrom(conf);
|
||||||
|
if fOutputFileName <> '' then
|
||||||
|
begin
|
||||||
|
patchPlateformPath(fOutputFileName);
|
||||||
|
expandFilenameEx(fBasePath, fOutputFileName);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
item := fJSON.Find('name');
|
||||||
|
if assigned(item) then
|
||||||
|
fOutputFileName := item.AsString;
|
||||||
|
end;
|
||||||
|
case fBinKind of
|
||||||
|
executable: fOutputFileName += exeExt;
|
||||||
|
staticlib: fOutputFileName += libExt;
|
||||||
|
obj: fOutputFileName += objExt;
|
||||||
|
sharedlib: fOutputFileName += dynExt;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCEDubProject.updateFields;
|
procedure TCEDubProject.updateFields;
|
||||||
begin
|
begin
|
||||||
updatePackageNameFromJson;
|
updatePackageNameFromJson;
|
||||||
|
@ -611,6 +651,7 @@ begin
|
||||||
updateSourcesFromJson;
|
updateSourcesFromJson;
|
||||||
updateTargetKindFromJson;
|
updateTargetKindFromJson;
|
||||||
updateImportPathsFromJson;
|
updateImportPathsFromJson;
|
||||||
|
updateOutputNameFromJson;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEDubProject.beginModification;
|
procedure TCEDubProject.beginModification;
|
||||||
|
|
Loading…
Reference in New Issue