Gradle ant task multiple/concatenated classpath

Hey.

I’m trying to invoke hibernatetool as an ant task and I need to define classpath that in relevant ant build script is defined like:

        <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
			<classpath>
				<fileset dir="${base.dir}/WebContent/WEB-INF/lib">
					<include name="*.jar" />
				</fileset>
				<pathelement location="${war.dir}/WEB-INF/classes"/>
			</classpath>
		</taskdef>

My version of gradle taskdef is

ant.taskdef(name:'hibernatetool', classname: 'org.hibernate.tool.ant.HibernateToolTask', classpath: configurations.runtimeClasspath.asPath+files("${warClassesDir}"))

However, ant task doesn’t seem to see the classes defined in the files("${warClassesDir}") part.
What shouild I fix to make it working?

Translating this into gradle would be something like

configurations {
   hibernateTool
} 
dependencies {
   hibernateTool fileTree('WebContent/WEB-INF/lib') {
      include '*.jar'
   } 
   hibernateTool sourceSets.main.runtimeClasspath 
} 
task myTask {
   doLast {
      ant.taskdef(name:'hibernatetool', classname: 'org.hibernate.tool.ant.HibernateToolTask', classpath: configurations.hibernateTool.asPath)
      ant.hibernatetool(...)
   } 
}