build.gradle and build.xml fixes (was in a previous Pull Request - #16 - but I screwed things up)

This is the same set of changes as pull request #16, but that got screwed up.  This one is the real deal.