Skip to main content



      Home
Home » Modeling » TMF (Xtext) » How to prevent a dsl file to be built if it is not in the classpath
How to prevent a dsl file to be built if it is not in the classpath [message #1849633] Thu, 27 January 2022 08:36 Go to next message
Eclipse UserFriend
Hello,

I would like that my dsl files which are not on the java classpath to be ignored by the xtext builder for generation/validation.

I tried to use the StrictJavaProjectsState with Domainmodel example.
I added in DomainmodelUiModule
	  @Override
	  public Provider<IAllContainersState> provideIAllContainersState()
	  {
	    return Access.getStrictJavaProjectsState();
	  }


Then I created a java project with a test.dmodel in the src folder.
Its content is correctly generated in src-gen folder as expected.

Then I moved test.dmodel in a folder outside the java classpath. I was expecting that the file will be ignored but it is not the case, its content is generated in src-gen folder.

How can I prevent this behaviour ?

Regards,

Yannick
Re: How to prevent a dsl file to be built if it is not in the classpath [message #1849635 is a reply to message #1849633] Thu, 27 January 2022 08:40 Go to previous messageGo to next message
Eclipse UserFriend
you may check org.eclipse.xtext.ui.resource.DefaultResourceUIServiceProvider.canHandle(URI, IStorage)
Re: How to prevent a dsl file to be built if it is not in the classpath [message #1849636 is a reply to message #1849635] Thu, 27 January 2022 08:53 Go to previous messageGo to next message
Eclipse UserFriend
Ok thanks

I think that https://github.com/eclipse/xtext-xtend/blob/master/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/XtendResourceUiServiceProvider.java
will do the job.
Re: How to prevent a dsl file to be built if it is not in the classpath [message #1849642 is a reply to message #1849636] Thu, 27 January 2022 10:10 Go to previous message
Eclipse UserFriend
yes
Previous Topic:Formatting comma-separated list with new line & indent
Next Topic:Xtend and Xtext
Goto Forum:
  


Current Time: Sat Apr 26 05:08:02 EDT 2025

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

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

Back to the top