Skip to content

Instantly share code, notes, and snippets.

@melix
Created February 18, 2013 16:21
Show Gist options
  • Save melix/4978556 to your computer and use it in GitHub Desktop.
Save melix/4978556 to your computer and use it in GitHub Desktop.
Script imports in groovy
static void greet(String name) { println "Hello, $name!" }
import static Functions.*
greet 'Tim'
$ groovy MyScript
Hello, Tim!
$
@melix
Copy link
Author

melix commented Feb 18, 2013

Depending on what you want to do and how you execute the script, the import can also be totally removed and replaced with smart compiler configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment