Hello everybody,
I am working on tools for Common API C [1] that should enable
translating Franca IDL into C code. The generated code would enable,
for example, invoking a method defined by a Franca interface via an
IPC mechanism while hiding the protocol details from the application.
Different IPC mechanisms such as D-Bus can be supported by independent
backends.
So far I have created a set of Maven/Tycho projects that create a
Eclipse UI plugin and a standalone binary to invoke the generator
functionality. They currently accept one Franca file as their input
and are capable of producing several output files. I also created a
test generator based on Franca Runtime, Xtend and integrated via JUnit
(as described in Franca User Manual).
Now I need to integrate the generator with 'real' Eclipse plugins (no
JUnit, etc.) that feed it with input files and store the generated
code in output files. In order to load the Franca model, I currently
adopted (actually copied) the method loadModel() as implemented by
org.franca.connectors.idl.
tests.IdlTestBase:
protected FModel loadModel(String filename) {
FrancaIDLStandaloneSetup.doSetup();
ResourceSet resourceSet = new ResourceSetImpl();
Resource res = resourceSet.getResource(URI.createFileURI(filename), true);
FModel root = (FModel)res.getContents().get(0);
return root;
}
I pass it the result of IFile.getLocation().toString() as filename and
it seems to work in my environment so far, but I wonder if this is the
intended way to implement model loading.
Any hints would be highly appreciated.
Regards,
--Pavel Konopelko
[1]
http://git.projects.genivi.org/?p=common-api/c-poc.git;a=summary