我想编写一个 Ant 脚本来调用需要完整路径的外部实用程序(实际上是 Inkscape)。现在我有
<exec executable="${inkscape.path}">
<arg value="--file=build_exe/splash.svg" />
<arg value="--export-png=build_exe/splash.png" />
<arg value="-C" />
</exec>
在 Windows 上,Inkscape requires absolute paths .那么我怎样才能哄Ant 把build_exe/filename
变成我的绝对路径呢?或者,Inkscape 是否有解决方法(可能设置工作目录)?
最佳答案
使用这个:
<property name="x" location="folder/file.txt" />
${X}
值将是文件相对于 ${basedir}
值的绝对路径。
关于ant - 在 Ant 脚本中扩展相对路径,用于 Inkscape,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/894701/