OSX : split Groovy script into multiple files -


on osx, can create executable groovy script follows:

file: somescript.groovy

#!/usr/bin/env groovy println "hello!!!!"; 

chmod +x ./somescript.groovy

how use same approach, split cmd-line app multiple files? (as many ruby cmd-line gems do).

i need quick light-weight, easy modify scripting, @ same time being able split files 10 or 20 classes.

if create separated logics in groovy classes (ex. utils.groovy) statics methods.

class utils{     static helloworld(){         println “hello world!"     } } 

then in script can write

…mylogic… helloworld() …mylogic… 

groovy load automatically utils.groovy class if it’s in same dir of script


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -