Replies: 6 comments 4 replies
-
|
Would using Ant properties to define base paths and setting them via command-line arguments work for your use case? If not, could you please share a minimal example so I can better understand the problem? |
Beta Was this translation helpful? Give feedback.
-
|
Hi Dimitri, please see attached |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very much for the detailed explanation. If we decide to support loading imported Epsilon files from configurable base locations (other than the base path of the importing program), the solution would need to work beyond Ant - including Epsilon's editors and debuggers - and it should also support EGX's loading of EGL templates. An alternative approach I'm considering is to introduce support for an What do you think about this approach? |
Beta Was this translation helpful? Give feedback.
-
|
I am worried about background state. With an environment variable this may magically work, but generally I would not want to set environment variables outside a build or system to do this. I recall that the ecore generator had similar issues (see my AI dig below to remind myself). It used There is even pre-prepared support for this in the Maybe this method could be wrapped for the various environments?
<platformUriMap>
<entry source="foo" target="file:///somewhere/on/disk/foo"/>
<entry source="bar" target="http://dimitris.code/bar"/>
</platformUriMap>(The
That may cover it? A very good description of resolution is here starting slide 14 After this, the resolution would occur as usual. Example:
Request is
this is run through the map and turns into If epsilon is in debug mode, it may log the expansion for clarity. This is then handled by the URIStreamHandlers that are active. Not sure how epsilon does that. Note that there is also support for stream handlers in the EcorePlugin. If that is used, the alignment would be even greater. If epsilon is in debug mode and has knowledge which resolution was chosen, it may log the expansion for clarity. After that, the resource is loaded
Short answer: it doesn’t—at least not automatically. When you run EMF code generation (or any EMF-based loader) outside the Eclipse workbench, URIs with the Below is how this works under the hood and the common ways to fix it. What happens inside EMF
The generator context (Ecore/GenModel)EMF’s code generator and many workflows read Standard solutions outside Eclipse1) Add explicit URI mappings on the
|
Beta Was this translation helpful? Give feedback.
-
|
The Epsilon core is independent from EMF, so we cannot directly reuse EMF mechanisms to resolve imports. Epsilon can parse a module referenced via a URI. The URI gets turned into a URL, which gets a URLStreamHandler via the registered factories, as documented in the Java standard library Javadocs: The Eclipse IDE sets up its own URLStreamHandlerFactory which handles In any case, I think one solution would be to allow the ImportManager to use more than just the For your attached example, you could then have these elements in the modulePath:
Then you could just do We could extend all Epsilon program tasks ( How does this sound? |
Beta Was this translation helpful? Give feedback.
-
|
I had a chat with Dimitris about the above approach, and it wouldn't be enough by itself, as we'd have to make tooling (IDE plugins / language servers) aware of this import path as well, or you'd start seeing error/warning markers in editors and you'd also have issues during debugging. Properly supporting such an import path idea would take quite a bit more time than what I first expected, and it'd impose more overheads on any tooling we develop in the future. After some brainstorming, we came up with an alternative that should both solve your issue and integrate cleanly with existing tooling: supporting a new URI style for imports that is more flexible about how it finds the file to be imported. The format would be something like:
The semantics of the URI would be:
In your example project, you could then import
If there was more than one
Would you like us to try and create a first version of the idea, so you can try it out and report back? Our plan would be to create a new URLStreamHandlerFactory to support this |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a system of generators running from ant, which use common eol scripts. However, the resolution of those scripts is relative to the running script. This means that cascading inputs are not easily possible. The answer seems to be to have multiple module paths for the task, one pointing at the location the script is (current ant directory), the other pointing at the framework root. However, there is no module path element on the ant tasks.
There are ways to do this in Java, and additional ant tasks could probably cover this. But I would rather not use such a helper.
So here is the question:
What is the current best practice to I configure multiple module paths within ant?
Beta Was this translation helpful? Give feedback.
All reactions