代码之家  ›  专栏  ›  技术社区  ›  Paul Fisher

在Ant脚本中展开Inkscape的相对路径

  •  3
  • Paul Fisher  · 技术社区  · 15 年前

    我想编写一个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是否有解决方案(可能是设置工作目录)?

    2 回复  |  直到 15 年前
        1
  •  5
  •   Mihai Toader    15 年前

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

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

        2
  •  0
  •   Pierre    15 年前

    我要宣布

    <property file="my_config.properties"/>
    

    我会把这个路径写在文件my_config.properties中。您的用户只需修改此配置文件。