Home » Eclipse Projects » Plugin Development Environment (PDE) » [PDE-Build] Build Groovy files
[PDE-Build] Build Groovy files [message #649966] |
Fri, 21 January 2011 09:06 |
|
Hi all,
I am more and more thinking to write some pieces of code in Groovy, aainly in my test plug-ins. That would reduce the cost of writing tests for the same coverage as Java.
I gave it a try yesterday, and could successfully integrate a Groovy class to a plug-in which had the Groovy nature enabled. So that I could run my Groovy test in my development workbench. The Groovy builder automatically generated me the .class file for my .groovy file, and I could use it in the uitestapplication. Good.
It became more complicated when I tried to use this test in headless build. Indeed, it seems that the headless build did not invoke the Groovy builder so that the .class was not generated. Before this event, I thought that the PDE-Build was relying on the JDT compiler, so that the Groovy compilation would be automatically triggered in automated build. But it seems that it is not the case.
An alternative would be to tweak the plug-in's build.xml to add a groovyc task, but that's not straightforward.
Are there any easier workarounds to get it working? Are there plans to make PDE-build extensible to allow JDT extensions such as Groovy-Eclipse to add their steps at compile-time?
Thanks in advance.
--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
|
|
| | | |
Re: [PDE-Build] Build Groovy files [message #650792 is a reply to message #650560] |
Wed, 26 January 2011 15:16 |
|
Le 25/01/2011 15:20, Andrew Eisenberg a écrit :
> The ant bug is fixed, yes. I am not sure if this version is being used in platform yet...it may for 3.6.2, I haven't checked.
You can get org.apache.ant_1.8.2 from Orbit, and I think there is no problem to use this one rather that the 1.7.1 in older Eclipse releases.
> But even if it is, you will still need the work around, it will just mean that I can refactor the workaround so that it will be simpler and there will be no unnecessary warnings.
Ok, isn't the JDTCompilerAdapter extensible? so that one can only plus some additional steps to this adapter, and headless build could benefit of all other JVM languages support that extended it without tweaks? That would be very cool!
--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
|
|
| |
Re: [PDE-Build] Build Groovy files [message #650949 is a reply to message #650884] |
Thu, 27 January 2011 09:26 |
|
> That's basically right. With the ant bug patched, you can create a Compiler adapter for groovy like this (much simpler than what is shipped with Groovy-Eclipse, but the same basic functionality):
>
>
> public class GroovyCompilerAdapter extends JDTCompilerAdapter implements CompilerAdapterExtension {
> public String[] getSupportedFileExtensions() {
> return new String[] { "*.java", "*.groovy" };
> }
> }
>
>
> You also need to edit your build.properties file as described in the blog post, but you can skip specifying the file extensions a second time.
What I have in mind is more a JDTCompilerAdapter that would come with an extension point to add support for other extensions, then there wouldn't have anything to change in build.properties, and PDE-build would be able to build Groovy whenever the extension for .groovy files is present in the platform.
Or to have a ExtensibleDispatcherCompilerAdapter that would dispatch the compile steps to several CompilerAdapter (eg JDT, Groovy) according to their extension.
That way, we could imagine to have plugin in any JDT-friendly language, and to have polyglot bundles without other effort than installing a new language support in Eclipse. This would allow people to write bundles in most of JVM languages. (currently Java, Groovy, Scala; and probably Clojure, Jython and so on in the future...).
--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
|
|
| | |
Goto Forum:
Current Time: Wed Sep 25 14:25:57 GMT 2024
Powered by FUDForum. Page generated in 0.04352 seconds
|