Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 蚂蚁的最大函数_Ant_Max - Fatal编程技术网

Ant 蚂蚁的最大函数

Ant 蚂蚁的最大函数,ant,max,Ant,Max,我有通过以下模式创建的目录build\u yyyyMMdd\u hhmmssss i、 e build\u 20130304\u 112343142 build\u 20130402\u 102141121 我需要确定ant build中最新创建的目录 蚂蚁有某种max函数吗 或者你可以向我提出另一个想法 Thansk因为构建(以及目录名)实际上也是按字母顺序排列的 ls-rd | tail-n1 应提供最新的目录。使用,即回显最新创建的目录: 按名称排序: <resources id="

我有通过以下模式创建的目录
build\u yyyyMMdd\u hhmmssss

i、 e
build\u 20130304\u 112343142

build\u 20130402\u 102141121

我需要确定ant build中最新创建的目录

蚂蚁有某种max函数吗

或者你可以向我提出另一个想法

Thansk

因为构建(以及目录名)实际上也是按字母顺序排列的

ls-rd | tail-n1

应提供最新的目录。

使用,即回显最新创建的目录:

按名称排序:

<resources id="foobar">
 <!-- default last count="1" -->
 <last>
  <sort>
   <name/>
    <dirset dir="path/to/rootdir">
     <include name="build*" />
    </dirset>
  </sort>
 </last>
</resources>

<echo>${toString:foobar}</echo>

${toString:foobar}
按日期排序:

<resources id="foobar">
 <!-- default last count="1" -->
 <last>
  <sort>
   <date/>
    <dirset dir="path/to/rootdir">
     <include name="build*" />
    </dirset>
  </sort>
 </last>
</resources>

<echo>${toString:foobar}</echo>

${toString:foobar}
Ant 1.7随附,可与
一起使用。。等等