Dsl runtime library [message #1850087] |
Tue, 15 February 2022 13:57  |
Eclipse User |
|
|
|
Hello,
I would like to have a runtime library for my Dsl.
In the dev Eclipse I created a new plugin project mydsl.lib in which I added the file library.mydsl in a source folder.
In the runtime eclipse I created a project with a dependecy in the manifest on mydsl.lib. It is not possible to refers to types defined in library.mydsl.
If I import the mydsl.lib project inside the runtime eclipse it works. Is it possible to avoid this import ?
Regards
Yannick
|
|
|
Re: Dsl runtime library [message #1850088 is a reply to message #1850087] |
Tue, 15 February 2022 14:03   |
Eclipse User |
|
|
|
If you model project is a plugin project
And the lib project is a plugin project too, then it should work
If you add dependency to manifest as you would do it for normal plugin development
=> am not sure what your question exactly is about
[Updated on: Tue, 15 February 2022 14:21] by Moderator Report message to a moderator
|
|
|
Re: Dsl runtime library [message #1850089 is a reply to message #1850088] |
Tue, 15 February 2022 14:29   |
Eclipse User |
|
|
|
Ok thanks Christian
Maybe something is wrong in my conf.
- This is my plugin library (on dev Eclipse)
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Automatic-Module-Name: mydsl.lib
Bundle-ManifestVersion: 2
Bundle-Name: MyDsl Runtime Library
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: mydsl.lib;singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
build.properties
bin.includes = .,\
META-INF/,\
lib/
source.. = lib/
my library file test.mydsl is in lib folder
- in the Test project (runtime Eclipse)
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Automatic-Module-Name: Test
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: Test; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: mydsl.lib
In the Plug-in dependencies of Test project I see :
Plug-in dependencies
classes - /path/to/mydsl.lib/target
test.mydsl
Both project are plugin project with the xtext nature/builder.
I don't understand why it's not working.
Thanks
Yannick
|
|
|
Re: Dsl runtime library [message #1850090 is a reply to message #1850089] |
Tue, 15 February 2022 14:38   |
Eclipse User |
|
|
|
I will try to clarify what I need:
I need a dsl library that will contain some predefined types. This library will be installed with all other xtext plugins (mydsl, mydsl.ide, mydsl.ui, ...).
On the eclipse with installed mydsl language and lib, I would like to be able to add a dependency on mydsl.lib in the Manifest to access predefined types.
The problem seems to be that the library is visible but not built.
|
|
|
|
|
Re: Dsl runtime library [message #1850096 is a reply to message #1850088] |
Tue, 15 February 2022 16:41  |
Eclipse User |
|
|
|
Ok I found the problem.
I had a custom DefaultResourceUIServiceProvider (see https://www.eclipse.org/forums/index.php/t/1109970/) and the IStorage ".org.eclipse.jdt.core.external.folders" was not built.
I patched the canBuild method and now it's working
@Override
public boolean canBuild(URI uri, IStorage storage)
{
if (storage instanceof IFile)
{
final var file = (IFile) storage;
final var project = file.getProject();
final var javaProject = JavaCore.create(project);
if (".org.eclipse.jdt.core.external.folders".equals(project.getName()))
{
return true;
}
return isInSourceFolder(javaProject, file);
}
// everything non local shouldn't be indexed at all, as we are going to link against Java.
return false;
}
Thanks
[Updated on: Tue, 15 February 2022 16:43] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06617 seconds