In our project we have a common.xml which is included in all our ant files. This common.xml has all common tasks we use in our project.
Recently we wanted to use ant-contrib in our project. so we have included following task def in our common.xml
<project name="CommonTasks" basedir="." xmlns:ac="antlib:net.sf.antcontrib">
<taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml>
<classpath>
<pathelement location="/usr/lib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
</project>
in one of our build.xml we have following code
<project name="Build" basedir=".">
<import file="common.xml" />
<ac:if>
<ac:not>
<isset property="android.available" />
</ac:not>
<ac:then>
<echo message="android is not available" />
</ac:then>
</ac:if>
</project>
Now we assumed that as the namespace is defined in common.xml the same will get imported in our build.xml. But this is not happening. Instead i need to include xmlns:ac="antlib:net.sf.antcontrib" eacch for my build.xml. i.e my build.xml should be like below
<project name="Build" basedir="." xmlns:ac="antlib:net.sf.antcontrib">
<import file="common.xml" />
<ac:if>
<ac:not>
<isset property="android.available" />
</ac:not>
<ac:then>
<echo message="android is not available" />
</ac:then>
</ac:if>
</project>
Is there a way to do this namespace import instead in all our build.xml instead of defining the same namespace definition in all our build.xml