2009-05-21 36 views
3

我想编写一个调用实际需要完整路径的外部实用程序(Inkscape)的Ant脚本。现在我有在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> 

在窗口上,Inkscape requires absolute paths。那么我怎么能哄蚂蚱把build_exe/filename变成我的绝对路径呢?或者,或者,Inkscape有没有解决方法(可能是设置工作目录)?

回答

5

使用本:

<property name="x" location="folder/file.txt" /> 

${X}值将是相对${basedir}值的文件的绝对路径。

+0

完美!许多指向你:) – 2009-05-21 20:51:25

0

我将宣布

<property file="my_config.properties"/> 

,我会写在文件my_config.properties这条道路。你的用户只需要修改这个配置文件。