2009-05-21 75 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這條道路。你的用戶只需要修改這個配置文件。