Problems using ant.importBuild with ant-file using basedir != "."


(Johan Erlands) #1

I was trying to use gradle to import an ant build, but it fails to set

properties correct because the ant buildfile has a different basedir than

default.

I used this buildfiles: /ant/app/test.xml. /build.gradle

test.xml:

build.gradle: ant.importBuild ‘ant/app/test.xml’

When i run ‘grade test’ i get this output:

[ant:echo] /ant/app

[ant:echo] /ant/app/foo

Instead of the expected

[ant:echo]

[ant:echo] /foo

I think this is is because org.gradle.api.internal.project.DefaultAntBuilder

assumes that basedir is the directory where the ant-build file is intsead of

reading it.


(Peter Niederwieser) #2

It’s a known limitation. Perhaps vote for http://issues.gradle.org/browse/GRADLE-2039.