Groovy Tip of the day 2007-01-04


Here’s a little gem I whipped up to help me install the latest Groovy. Can you tell what it does?

groovy -e "new File('/home/ccc/apps/groovy-1.0-RC-01/lib').eachFile { if(! new File('/home/ccc/apps/groovy-1.0/lib').list().toList().contains(it.name)) println it }"

When I first installed Groovy I started loading it’s lib folder down with extra stuff. Now that I think of it a better place for extra stuff is in $HOME/.groovy/lib. But I still don’t know which things were there originally (in my Groovy-1.0.-RC install) and which things I added. I needed to find which files in one folder didn’t exist in another. After reading Groovy In Action I’m starting to get more comfortable with groovy command line use. So the above ran right off of my command line and told me which Jars were left out. Slick!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s