开发者

How to to control the order of merge in Ant file

I have this code which takes all the files in the folder collection and merges them with the covers.js file. The problem is there are 2 files inside of collections that need to be merged below covers. But possibly I may want to control the order of how the files are being merged from the collection folder. IS there a dependency attribute I can use.

<target name="merge box">
    <echo>${box.file}</echo>
    <concat destfile="${box.file}" fixlastline="yes" append="no">
    <fileset dir="${js.src.dir}/components/covers/" includes="**/*.js"/>
    <fileset dir="${js.src.dir}/collection/" includes="**/*.js" excludes="base.js"/>
    </concat>
</target>

Update I also tried this but still doesn't work.

      <fileset dir="${js.src.dir}/collection" >
           <includesfile name="Templates.js" />
            <includesfile name="popup.js" />
            <includesfile name="popup-extend.js" />
        </fileset>

Latest Update

Tried this and it works but it doesn't hold the order of the include files.

<target name="merge box">
<echo>${box.file}</echo>
<concat destfile="${box.file}" fixlastline="yes" append="no">
<fil开发者_高级运维eset dir="${js.src.dir}/components/covers/" includes="**/*.js"/>
<fileset dir="${js.src.dir}/collection" >
      <include name="Templates.js" />
      <include name="popup.js" />
      <include name="popup-extend.js" /> 
    </fileset>
    </concat>
</target>

popup-extend is meant to be merged below the popup code but its not doing that matter what order I put them in it will always put it in this order.

Templates

popup

popup-extend

The order I'm trying to get it in is

Templates

popup-extend

popup


Try this:

<target name="merge box">
    <echo>${box.file}</echo>
    <concat destfile="${box.file}" fixlastline="yes" append="no">
        <fileset dir="${js.src.dir}/components/covers/" includes="**/*.js"/>
        <fileset file="${js.src.dir}/collection/Templates.js" />
        <fileset file="${js.src.dir}/collection/popup.js" />
        <fileset file="${js.src.dir}/collection/popup-extend.js" />
    </concat>
</target>

Or look here: How to preserve file order in Ant concat?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜