本文介绍了如何美元的蚂蚁CONCAT p $ pserve文件顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何美元蚂蚁CONCAT p $ pserve文件顺序?

简单CONCAT与文件集&安培; includesfile产生,而随机顺序,顺序是不保证:

 < CONCAT destfile =C:/targetdir/concatenated.file>
    <文件集DIR =C:/ sourcedir />
        < includesfile NAME =C:/targetdir/includes.file/>
    < /文件集>
< / CONCAT>

我需要的是串联在特定的顺序的文件中列出了包含文件。

到目前为止,我已经发现的 resourcelist ,这应该preserve命令,但我似乎无法能够产生任何置文件与它。 :/

 < CONCAT destfile =C:/targetdir/concatenated.file>
    < resourcelist>
        <文件fil​​e =C:/targetdir/includes.file/>
        < filterchain>
            < striplinecomments>
                <注释值=#/>
            < / striplinecomments>
            < prefixlines preFIX =C:/ sourcedir //>
        < / filterchain>
    < / resourcelist>
< / CONCAT>

此外,该resourcelist似乎无法处理像

  LibraryX / A /东西/ Morestuff / *

代替行只是产生... / Morestuff / *不存在。 -error

包含文件具有相对路径的列表:

  LibraryX / A /东西/ FileA.txt
LibraryX / A /东西/ FileB.txt
LibraryX / A /东西/ FileC.txt
LibraryX / A /东西/ FileY.txt


解决方案

我能得到一个文件列表轻松地工作pretty:

 < CONCAT destfile =C:/targetdir/concatenated.file>
    <文件列表DIR =C:/ sourcedir />
        <文件名=i.txt/>
        <文件名=n.txt/>        <文件名=o.txt/>
        <文件名=r.txt/>
        <文件名=d.txt/>
        <文件名=e.txt/>
        <文件名=r.txt/>
    < /文件列表>
< / CONCAT>

希望帮助!

How to preserve file order in Ant concat?

Simple concat with fileset & includesfile produces rather "random" order, as order is not guaranteed:

<concat destfile="C:/targetdir/concatenated.file">
    <fileset dir="C:/sourcedir/">
        <includesfile name="C:/targetdir/includes.file" />
    </fileset>
</concat>

What I need is concatenation in specific order that the files are listed in the includes file.

So far I've found resourcelist, which should preserve order, but I can't seem to be able to produce any concatenated file with it. :/

<concat destfile="C:/targetdir/concatenated.file">
    <resourcelist>
        <file file="C:/targetdir/includes.file"/>
        <filterchain>
            <striplinecomments>
                <comment value="#"/>
            </striplinecomments>
            <prefixlines prefix="C:/sourcedir/"/>
        </filterchain>
    </resourcelist>
</concat>

Plus, the resourcelist can't seem to handle rows like

LibraryX/A/Stuff/Morestuff/*

Instead the row just produces a ".../Morestuff/* does not exist." -error

Includes file has list of relative paths:

LibraryX/A/Stuff/FileA.txt
LibraryX/A/Stuff/FileB.txt
LibraryX/A/Stuff/FileC.txt
LibraryX/A/Stuff/FileY.txt
解决方案

I was able to get a filelist working pretty easily:

<concat destfile="C:/targetdir/concatenated.file">
    <filelist dir="C:/sourcedir/">
        <file name="i.txt" />
        <file name="n.txt" />

        <file name="o.txt" />
        <file name="r.txt" />
        <file name="d.txt" />
        <file name="e.txt" />
        <file name="r.txt" />
    </filelist>
</concat>

Hope that helps!

这篇关于如何美元的蚂蚁CONCAT p $ pserve文件顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 08:24