Expand a relative path in Ant script, for Inkscape

此生再无相见时 提交于 2019-12-12 12:33:11

问题


I'd like to write an Ant script that calls an external utility (Inkscape, in fact) that needs a full path. Right now I have

<exec executable="${inkscape.path}">
    <arg value="--file=build_exe/splash.svg" />
    <arg value="--export-png=build_exe/splash.png" />
    <arg value="-C" />
</exec>

On Windows, Inkscape requires absolute paths. So how can I coax Ant to make build_exe/filename into an absolute path for me? Or, alternately, is there a workaround for Inkscape (maybe setting the working directory)?


回答1:


use this:

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

the ${X} value will be the absolute path of the file relative to the ${basedir} value.




回答2:


I would declare

<property file="my_config.properties"/>

and I would write this path in the file my_config.properties. Your users will just have to modify this config file.



来源:https://stackoverflow.com/questions/894701/expand-a-relative-path-in-ant-script-for-inkscape

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!