【问题标题】:Concat files in Apache ANT to variable?将Apache ANT中的文件连接到变量?
【发布时间】:2012-02-02 06:02:38
【问题描述】:

我知道我可以使用 ANT 的concat 将多个文件合并为一个文件。但是将文件合并到变量中呢?

这个可以吗?

【问题讨论】:

    标签: ant build


    【解决方案1】:

    concat可以作为资源集合使用,所以可以在loadresource中使用:

    <loadresource property="the.property">
      <concat>
        <file file="foo.txt" />
        <file file="another_file.txt />
        <string>You can put any resource in here, not just files!</string>
      </concat>
    </loadresource>
    

    现在the.property 属性将包含concat 内所有资源的串联。 (当您说变量时,我假设您的意思是蚂蚁属性。)

    【讨论】:

    • 太好了。完全错过了!非常感谢
    猜你喜欢
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-23
    • 1970-01-01
    • 2016-06-14
    • 2020-09-23
    • 2011-09-02
    相关资源
    最近更新 更多