use project.afterEvaluate {} to defer configuration

http://stackoverflow.com/a/25388282