2009-09-28 273 views
4

我需要能够在可能或可能不是兄弟的项目文件夹的预先指定列表上调用subant任务。如何指定subant任务的文件夹列表

我知道我可以打电话给subant任务是这样的:

<subant antfile="custom-build.xml" target="custom-target" 
     inheritall="false" failonerror="true"> 
    <filelist dir="${parent.dir}"> 
    <file name="project1"/> 
    <file name="project2"/> 
    ... 
    <file name="projectn"/> 
    </filelist> 
</subant> 

这是好的,如果所有的“项目”是在文件系统中的兄弟姐妹,但它可能不是这样,所以我需要一种方法来通过绝对路径名告诉subant显式的文件夹列表以查找要执行的custom-build.xml文件。

回答

3

添加更多文件清单:,每个路径,像这样:

<subant antfile="custom-build.xml" target="custom-target" 
    inheritall="false" failonerror="true"> 

<filelist dir="${parent.dir}"> 
    <file name="project1"/> 
    <file name="project2"/> 
    ... 
    <file name="projectn"/> 
</filelist> 

<filelist dir="${another.parent.dir}"> 
    <file name="projectA"/> 
    <file name="projectB"/> 
    ... 
    <file name="projectZ"/> 
</filelist> 

</subant> 
+0

没关系,它的丑陋,但它的作品...谢谢 – 2009-09-29 11:02:56

相关问题