Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Dsl runtime library
Dsl runtime library [message #1850087] Tue, 15 February 2022 08:57 Go to next message
Eclipse UserFriend
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 09:03 Go to previous messageGo to next message
Eclipse UserFriend
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 09:21] by Moderator

Re: Dsl runtime library [message #1850089 is a reply to message #1850088] Tue, 15 February 2022 09:29 Go to previous messageGo to next message
Eclipse UserFriend
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 09:38 Go to previous messageGo to next message
Eclipse UserFriend
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 #1850092 is a reply to message #1850090] Tue, 15 February 2022 10:06 Go to previous messageGo to next message
Eclipse UserFriend
maybe you need exports on lib project and put stuff into source folder
can you please provide a complete reproducer

[Updated on: Tue, 15 February 2022 10:24] by Moderator

Re: Dsl runtime library [message #1850093 is a reply to message #1850092] Tue, 15 February 2022 10:35 Go to previous messageGo to next message
Eclipse UserFriend
index.php/fa/41675/0/

with my simple experiments i cannot reproduce your problem

Re: Dsl runtime library [message #1850096 is a reply to message #1850088] Tue, 15 February 2022 11:41 Go to previous message
Eclipse UserFriend
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 11:43] by Moderator

Previous Topic:How to have both cross references and non cross references for a rule?
Next Topic:Convert RCP plugin project to a Maven project
Goto Forum:
  


Current Time: Thu Mar 13 15:07:15 EDT 2025

Powered by FUDForum. Page generated in 0.06050 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top