【问题标题】:Expand a relative path in Ant script, for Inkscape在 Ant 脚本中展开相对路径,用于 Inkscape
【发布时间】:2009-05-21 19:33:54
【问题描述】:

我想编写一个调用需要完整路径的外部实用程序(实际上是 Inkscape)的 Ant 脚本。现在我有

<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 的解决方法(可能是设置工作目录)?

【问题讨论】:

    标签: ant build-automation filenames inkscape


    【解决方案1】:

    使用这个:

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

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

    【讨论】:

      【解决方案2】:

      我要声明

      <property file="my_config.properties"/>
      

      我会将此路径写入文件 my_config.properties。您的用户只需修改此配置文件。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-28
        • 2015-09-08
        • 1970-01-01
        • 2011-10-30
        相关资源
        最近更新 更多