Skip to content

Instantly share code, notes, and snippets.

@ponkore
Created March 28, 2012 03:04
Show Gist options
  • Save ponkore/2223204 to your computer and use it in GitHub Desktop.
Save ponkore/2223204 to your computer and use it in GitHub Desktop.
groovy & groovyserv installation on OSX Lion
# groovy client with no arguments (startup server)
bash$ groovyclient
Invoking server: 'groovyserver' -p 1961
Groovy home directory: (none)
Groovy command path: /opt/local/bin/groovy (found at PATH)
GroovyServ home directory: /opt/local/share/devel/groovyserv
GroovyServ work directory: /Users/masao/.groovy/groovyserv
Original classpath: (none)
GroovyServ default classpath: /opt/local/share/devel/groovyserv/lib/*
Starting.....
groovyserver 57334(1961) is successfully started
error: neither -e or filename provided
usage: groovy [options] [args]
options:
-a,--autosplit <splitPattern> split lines using splitPattern (default '\s')
using implicit 'split' variable
-c,--encoding <charset> specify the encoding of the files
-classpath <path> Specify where to find the class files - must
be first argument
-cp,--classpath <path> Aliases for '-classpath'
-D,--define <name=value> define a system property
-d,--debug debug mode will print out full stack traces
-e <script> specify a command line script
-h,--help usage information
-i <extension> modify files in place; create backup if
extension is given (e.g. '.bak')
-l <port> listen on a port and process inbound lines
(default: 1960)
-n process files line by line using implicit
'line' variable
-p process files line by line and print result
(see also -n)
-v,--version display the Groovy and JVM versions
usage: groovyclient -C[option for groovyclient] [args/options for groovy]
options:
-Ch,-Chelp show this usage
-Cp,-Cport <port> specify the port to connect to groovyserver
-Ck,-Ckill-server kill the running groovyserver
-Cr,-Crestart-server restart the running groovyserver
-Cq,-Cquiet suppress statring messages
-Cenv <substr> pass environment variables of which a name
includes specified substr
-Cenv-all pass all environment variables
-Cenv-exclude <substr> don't pass environment variables of which a
name includes specified substr
# groovy & groovyserv installation
bash$ sudo port install groovy
Password:
---> Computing dependencies for groovy
---> Fetching archive for groovy
---> Attempting to fetch groovy-1.8.6_0.darwin_11.noarch.tbz2 from http://packages.macports.org/groovy
---> Fetching groovy
---> Attempting to fetch groovy-src-1.8.6.zip from http://distfiles.macports.org/groovy
---> Verifying checksum(s) for groovy
---> Extracting groovy
---> Applying patches to groovy
---> Configuring groovy
---> Building groovy
---> Staging groovy into destroot
---> Installing groovy @1.8.6_0
---> Activating groovy @1.8.6_0
---> Cleaning groovy
bash$ sudo port install groovyserv
---> Computing dependencies for groovyserv
---> Fetching archive for groovyserv
---> Attempting to fetch groovyserv-0.9_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/groovyserv
---> Fetching groovyserv
---> Attempting to fetch groovyserv-0.9-macosx-x86_64-bin.zip from http://distfiles.macports.org/groovyserv
---> Verifying checksum(s) for groovyserv
---> Extracting groovyserv
---> Configuring groovyserv
---> Building groovyserv
---> Staging groovyserv into destroot
---> Installing groovyserv @0.9_0
---> Activating groovyserv @0.9_0
---> Cleaning groovyserv
bash$
bash$ time groovyclient test.groovy
Hello, world
real 0m0.052s
user 0m0.001s
sys 0m0.003s
bash$
#
# very fast!
#
bash$ groovyclient -Ck
Invoking server: 'groovyserver' -p 1961 -k
Groovy home directory: (none)
Groovy command path: /opt/local/bin/groovy (found at PATH)
GroovyServ home directory: /opt/local/share/devel/groovyserv
GroovyServ work directory: /Users/masao/.groovy/groovyserv
Original classpath: (none)
GroovyServ default classpath: /opt/local/share/devel/groovyserv/lib/*
Killed groovyserver of 57334(1961)
bash$
def name='world'; println "Hello, $name";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment