Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow contributions to DSLD Classpath Container #304

Closed
felixdo opened this issue Jun 7, 2017 · 4 comments
Closed

Allow contributions to DSLD Classpath Container #304

felixdo opened this issue Jun 7, 2017 · 4 comments

Comments

@felixdo
Copy link
Contributor

felixdo commented Jun 7, 2017

My plugin adds a dsl for an RCP application. I also have a DSLD file for the DSL. AFAIU at the moment, I have to tell the user to put the .dsld file into ~/.groovy/greclipse/dsld manually. I would rather like to tell groovy-eclipse that i would like to contribute descriptors from a given bundle in a given subfolder of that bundle to the DSLD Classpath Container, and that these descriptors would then be picked up automatically.

@aeisenberg
Copy link

It should be the case that adding your DSLD file to the /dsld folder of one of your plugins should work.

@felixdo
Copy link
Contributor Author

felixdo commented Jun 8, 2017

Not sure I understand. I am talking about deploying a dsld file in an installed plugin, like the ones in the org.codehaus.groovyXX/plugin_dsld_support folders. AFAIU the only plugin that is searched for dsld files is the currently active compiler plugin, see https://github.com/groovy/groovy-eclipse/blob/master/ide/org.codehaus.groovy.eclipse.dsl/src/org/codehaus/groovy/eclipse/dsl/classpath/DSLDContainerInitializer.java#L78

@aeisenberg
Copy link

Apologies, I forgot how this works. It's been a while. :)

So, only dsld files found on the classpath or in the global location are added. The reason is that dslds are typically associated with a library that is on the classpath. Even groovy-based plugins (eg- grails plugin) adds entries to the classpath.

And a reason against adding dslds from a plugin to a project is that these dslds would apply to all groovy projects in the entire workspace, regardless of whether or not they actually use the plugin.

So, here's a recommendation. Somewhere inside of your plugin, ensure that a classpath container is added to a project's classpath. This classpath container should add a path that adds the dsld. This is exactly how the grails plugin works.

@felixdo
Copy link
Contributor Author

felixdo commented Jun 8, 2017

Ok, thank you, it's all clear.

@felixdo felixdo closed this as completed Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants