Ant 基目录向上一级

Ant base directory up one level

在ant build 中,如何指定比基目录高一级的目录。我需要这样做,因为我将调用所有项目通用的一些库。

您可以像在命令行中一样使用 ..(在 Windows 或 Linux 中):

<property name="parent.dir" location="{base.dir}\.."/>

<target name="jar" description="JAR task" depends="compile">
    <jar destfile="yourresource.jar" basedir="${parent.dir}"/>
</target>