Rodl2code to generate RODLFILE.res from a RODL file that links another?

Hello,

I am trying to ensure my RODLFILE.res is always current, without having to depend on the IDE compilation to generate it.

I can generate the RODLFILE.res easily with the rodl2code.exe tool, but I can’t find what I need to do for it to include the linked rodl from my main (the one I pass to rodl2code) one. Apparently it just includes that one, even if when generating the res from the IDE it includes both.

I have, basically, a “types” only RODL that is included/referenced from the main RODL, that defines the services and methods.

Hmm. as long as the paths are correct for the include, rodl2code should include this automatically. Can you send me/us a small test case rodl combo (and details how they are located on disk) so we can have a look?

Thanks Marc.

I’ve sent via email two sets of RODL that I have tried here. The paths in the use section of the RODL are valid/correct as far as I can see, and both files are on the same folder.

Thanx, let me see.

Reproduced & logged.

Not sure of this is expected (if so, we should add an option), or not. I’ll have to check with the RODA team

Thanks!

1 Like

Hi,

this is expected behavior.

rodl2code just converts .RODL to .RES as is. it doesn’t merge uses RODLs.

as a temporary workaround, you can merge RODLs manually.

r :=  LoadLibraryFromXml(input);
RODLToXMLFile(r, dest)
r.free;

Thanks Evgeny,

Is this option going to be implemented in rodl2code at some point in the future?

Hi,

yes, it will be implemented.
currently CodeGen4 (and rodl2code) can only read .RODL but no write it.

as a temporary workaround, you can write simple application that generate .RES from RODL.

code is

program rodl2res;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  uROCOMInit,
  System.SysUtils, System.Classes,
  uRODL, uXMLToRODL, uRODLToXML, uROResWriter, uRORes;
const
  ExcludePrivateServices = True;
var
  l_rodl: TRODLLibrary;
  l_bytes: TBytes;
  l_source: TMemoryStream;
  l_dest: TMemoryStream;
begin
  if ParamCount <> 1 then begin
    writeln('usage');
    writeln('  '+ExtractFileName(ParamStr(0))+ ' rodlfile');
    Exit;
  end;
  l_rodl := LoadLibraryFromXml(ParamStr(1));
  l_bytes := RODLToXML(l_rodl, ExcludePrivateServices);
  l_source := TMemoryStream.Create;
  l_dest := TMemoryStream.Create;
  try
    l_source.Write(l_bytes, Length(l_bytes));
    l_source.Position := 0;
    WriteRES(l_source, l_dest, res_RODLFile);
    l_dest.SaveToFile(ChangeFileExt(ParamStr(1),'.RES'));
  finally
    l_source.Free;
    l_dest.Free;
    l_rodl.Free;
  end;
end.
1 Like

Thanks Evgeny. I’ll wait for the tool to be updated, it’s not too urgent this. I can keep producing the .RES with the IDE tools for the time being.

1 Like