1

我有一个目录,里面有很多模块。

好像:

C: 

|--Project 

      |----files

            |----Modul1
                    |----FoldersinModuls
            |----Modul2
                    |----FoldersinModuls
            |----Modul3
                    |----FoldersinModuls
            |----Modul4
                    |----FoldersinModuls

我需要这样的列表:Modul1,Modul2,Modul3,Modul4

但我唯一得到的是:C:\Project\files\Modul1,C:\Project\files\Modul2,C:\Project\files\Modul3,C:\Project\files\Modul4

<dirset id="list.moduls" dir="${basedir}" includes="*" excludes=".folder">
</dirset>
<pathconvert pathsep="," property="list.of.moduls" refid="list.moduls">
<mapper type="identity"/> 
</pathconvert>  
<echo message="${list.of.moduls}"/>
4

1 回答 1

0

@Jayan 我通过评论回答了它,因为我不得不离开我的工作场所。

我终于用这个答案解决了它:

替换 Ant 属性中的字符

答案 --> 如果您想要一个仅使用 Ant 内置函数的解决方案,请考虑以下问题:

这是我发现唯一有效的方法。直接生成/替换(如我所想)是不可能的。

于 2012-10-18T08:41:28.880 回答