Page 1 of 1

Groovy Scripting - Getting Started?

Posted: 26 Apr 2016, 20:23
by Tympanix
Hi there!

I am planning to code some Groovy scripts for my personal needs and would like some help with IDE integration in Eclipse or IntelliJ. All that is said at GitHub (https://github.com/filebot/scripts) is:
If you want to run scripts from a local file or if you want to make your own modifications just clone the repository into your local filesystem.
However this seems to be a simplification. The Groovy scripts strongly depend on classes from the core of Filebot (https://github.com/filebot/filebot). What is the best setup for Groovy development for Filebot if i want to:
  • Do unit testing of Groovy scripts right from the IDE
  • Have Groovy scripts resolve references to core Filebot classes/methods
I have already done the following:
  • Downloaded Filebot from source into my favourite IDE
  • Downloaded all dependencies from ivy.xml
  • Resolved correct Java and Groovy SDK
  • Tried to tie in the Groovy scripts without luck
The Groovy scripts have no package defined (default package) and uses no imports (nor from java classes or groovy classes) which seems strange to me. How do they fit in?

Thank you, Tym.

Re: Groovy Scripting - Getting Started?

Posted: 26 Apr 2016, 20:57
by rednoah
Well, FileBot scripts are written in the Groovy language, but you'll still need to run them with filebot -script instead of groovy because of all the extra that FileBot adds to the Groovy environment.


The FileBot Groovy Extensions are all defined here:

Format/Filter Expression Extensions: FileBot Script Extensions: Default Imports:
Just putting the filebot jar into the classpath should make the extension methods work, not sure how to set a base class and default imports.


I just write scripts with Sublime and run scripts with filebot -script so I'm not sure how to recreate the FileBot/Groovy environment in a Groovy IDE and get code completion and unit testing and stuff like that.

Depending on what you're doing it's good to have the filebot source as a reference, but you don't really need it for anything other than "documentation" of all the FileBot/Groovy extensions.

Re: Groovy Scripting - Getting Started?

Posted: 26 Apr 2016, 21:34
by Tympanix
Oh! So that's how it ties in. I was quite sure i had missed something.

Thank you - old school with sublime text it is! :D

Re: Groovy Scripting - Getting Started?

Posted: 17 Jun 2025, 16:27
by rednoah