It appears that currently, imports in Franca models have to be either relative to the current file or an absolute location.
Is it possible to declare imports relative to a common root directory?
I have the following project structure:
/path/to/my/project/folder1/file1.fidl
/path/to/my/project/folder2/file2.fidl
If I want to import elements from file1 in file2, - to keep things portable - I have to use a relative path: "../folder1/file1.fidl".
I would prefer to set the project root directory to /path/to/my/project and use this as base for all imports, so that I can write "folder1/file1.fidl" (or something equivalent) instead.
I tried Franca 0.8.11 and I couldn't find this feature, neither in the IDE nor in the Java API.
Thanks a lot!
Lorenz
for me a much more common situation than having a single root directory to which imports should be relative is having multiple potential roots in which relative import paths have to be searched (think of include search paths in C/C++ or the already mentioned classpath in Java).
Therefore, I want to add two questions:
(1) Will this be supported in a later Franca version? Are there concrete plans?
(2) You are stating that classpath URIs already support this. How can I configure (or extend) them with my own custom classpath entries - especially in a C/C++ project?
Kind regards
Klaus
I had exactly the same requirement in a customer project.
And I came up with a fairly general solution where the model resolution algorithm is taken from extensions (if called e.g. from the editor) or can be set explicitly (if called in a non OSGi headless environment).
I'm one of the project leads of the Eclipse eTrice project (eclipse.org/etrice) and I've implemented this solution there.
In both, eTrice and the customer project using a patched Franca version, the solution is working like a charm.
There is also a Franca patch in preparation. This is still lacking a default resolution mechanism which would allow the unit tests to succeed again. As soon as I can find the time I would complete the task and send a pull request to the Franca project.
I wouldn't use the classpath mechanism in C/C++ projects since it is (in my opinion) not transparent and also unnatural for C/C++ projects.
Regards,
Henrik
that sounds great. Maybe you can give Klaus Birken a heads up so that he can check if your solution fits the overall project structure (maybe you have already done so).
Kind regards
Klaus
I absolutely agree with you. It would only be a temporary solution until a better resolution mechanism is available.
Kind regards
Klaus