Created
February 18, 2013 16:21
-
-
Save melix/4978556 to your computer and use it in GitHub Desktop.
Script imports in groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void greet(String name) { println "Hello, $name!" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static Functions.* | |
greet 'Tim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ groovy MyScript | |
Hello, Tim! | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.