Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:36 Go to next message
Yannick DAVELUY is currently offline Yannick DAVELUYFriend
Messages: 39
Registered: July 2020
Member
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 13:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
you may check org.eclipse.xtext.ui.resource.DefaultResourceUIServiceProvider.canHandle(URI, IStorage)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 13:53 Go to previous messageGo to next message
Yannick DAVELUY is currently offline Yannick DAVELUYFriend
Messages: 39
Registered: July 2020
Member
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 15:10 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
yes

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Formatting comma-separated list with new line & indent
Next Topic:Xtend and Xtext
Goto Forum:
  


Current Time: Wed Apr 24 22:55:41 GMT 2024

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

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

Back to the top