Gradle build time: Sunday, April 29, 2012 11:51:52 PM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.2 compiled on December 20 2010 Ivy: 2.2.0 JVM: 1.6.0_17 (Sun Microsystems Inc. 14.3-b01) OS: Linux 2.6.9-67.ELsmp amd64
Are you sure that the task gets executed? The second snippet will always do the copy, no matter which tasks get executed. (Obviously, that’s not what you want.)
Another try is to move ‘ant.property(file:‘build.properties’)’ inside the task’s configuration block. That said, Gradle’s Ant integration isn’t really meant to be used in this way, so you are probably better off accessing the properties file directly. Something like:
def buildProperties = file('build.properties').withReader { new Properties().load(it) }