Sky's blog

我和我追逐的梦

常用链接

统计

其他链接

友情链接

最新评论

ivy中文参考文档(13)-ant任务(1)-buildlist

    buildlist任务用于获取按照ivy依赖信息从小到大排序的文件(通常是build.xml文件) 列表,或者相反(从1.2之后)

    这个任务在结合subant构建相关项目集合时特别有效, 可以确保依赖在其他依赖它的模块之前被构建。

    当你要排序的模块的ivy.xml不包含修订版本号,在依赖上定义的rev属性将不被使用。
    当你要排序的模块的ivy.xml包含修订版本号,修订版本号将被使用。如果修订版本号和依赖描述不匹配,将会记录警告日志而模块被认为是不同的模块.

    从1.3版本起,root属性也可以用来在找到的所有模块之中只选择依赖(不管式直接还是间接)root模块的模块。可以和excluderoot属性同时使用,当设置为true时将从列表中排除root自己。

    从1.4版本起, leaf属性也可以用来在找到的所有模块之中只选择依赖(不管式直接还是间接)leaf模块的模块。可以和excludeleaf属性同时使用,当设置为true时将从列表中排除leaf自己。

    从1.4版本起, 在这个任务执行之后ivy.sorted.modules属性将在ant中设置,值为逗号分隔的排序好的模块列表。这可以用于调试或者报告。

    从2.0版本起,root和leaf属性可以是用来作为root的模块的分隔列表。这些模块和他们所有的模块将被包含在构建列表中。

    从2.0版本起,默认所有循环依赖的模块将被组合,以便在这个循环中的任何模块的任何依赖都在循环中的模块前出现。如果有一个依赖路径在模块A和B之间(但是没有从B到A的依赖路径),B将在A之前出现,即使A被包含在一个用来排序的模块集合的循环中。

    从2.0版本起,当你指定roo和leaf模块你可以限制结果列表为只有root模块的直接依赖或者leaf模块的直接依赖。

    从2.0版本起,你可以指定一个restartFrom模块。和root或者leaf不同的是,你可以得到一个从restartFrom模块开始的,后面是如果这个参数没有设置时应该在后面的所有模块,的文件列表,(即使没有依赖在restartFrom和后面的模块之间)
 

属性
描述
要求
reference the reference of the path to set
要设置的路径引用
Yes
ivyfilepath the relative path from files to order to corresponding ivy files
从文件到对应的ivy文件的相对路径
No. 默认为 ${ivy.buildlist.ivyfilepath}
root since 2.0 the names of the modules which should be considered as the root of the buildlist.
从2.0起 模块名(可以是多个)将被认为是构建列表的root
since 1.3 Was limited to only one module name before 2.0.
从1.3起在2.0前被限制为只能设置一个模块名
No. 默认没有root (在构建列表中所有模块都将被使用)
excluderoot since 1.3 true if the root defined should be excluded from the list
从1.3起 true如果需要将定义的root排除在列表之外
No. 默认是false
leaf since 2.0 the names of the modules which should be considered as the leaf of the buildlist.
从2.0起 模块名(可以是多个)将被认为是构建列表的leaf
since 1.4.1 Was limited to only one module name before 2.0.
从1.4.1起在2.0前被限制为只能设置一个模块名
No. 默认没有leaf (在构建列表中所有模块都将被使用)
onlydirectdep since 2.0 true if the
resulting list should be restricted to direct dependencies of root modules or modules that directly depends on the leaf modules.
This field is ignored when neither root neither leaf is filled.
从2.0起 true如果结果列表被限制为root模块的直接依赖或者直接依赖leaf模块。当root和leaf都没有被设置时这个属性将被忽略
No. 默认是false
delimiter since 2.0 delimiter to use when specifying multiple module names in the root and leaf properties.
从2.0起 当指定多个模块名时在root和leaf属性中使用的分隔符
No. 默认是逗号(,).
excludeleaf since 1.4.1 true if the leaf defined should be excluded from the list
从1.4.1起 true如果需要将定义的leaf排除在列表之外
No. 默认是false
haltonerror true to halt the build when an invalid ivy file is encountered, false to continue
当遇到一个无效的ivy文件时,true终止构建,false继续
No. 默认是true
skipbuildwithoutivy Deprecated, use onMissingDescriptor instead. true to skip files of the fileset with no corresponding ivy file, false otherwise. If false the file with no corresponding ivy file will be considered as independent of the other and put at the beginning of the built filelist.
申明不赞成继续使用,请使用onMissingDescripto。
No. 默认是false
onMissingDescriptor since 2.0 Specify the action to take when no module descriptor file is found for a file of the fileset. Possible values are:
从2.0起 当文件集合中的一个文件找不到模块描述文件时指定处理动作:
  • head
  • put at the head of the built filelist.
  • tail
  • put at the tail of the built filelist.
  • skip
  • skip the file, which won't be put in the build filelist at all.
  • warn
  • warn and put at the head of the build filelist.
  • fail
  • halt the build with a failure.
No. Defaults to 'head'
reverse true to obtain the list in the reverse order, i.e. from the most dependent to the least one
true 用于获取倒叙排列的列表。例如从最大依赖到最小
No. 默认是 false
restartFrom since 2.0 The name of the module which should be considered as the starting point in the buildlist. This allows for the build to be started at any point in the dependency chain.
从2.0起 被认为是构建列表的起点的模块的名字。这容许构建从依赖链的任意节点开始。
No. 默认没有restart point (在构建列表中所有模块都将被使用).
settingsRef since 2.0 A reference to the ivy settings that must be used by this task
从2.0起 必须被这个任务使用的ivy设置的一个引用。
No, 默认使用'ivy.instance'.



内嵌元素参数说明
fileset
文件集合用于选择文件集合来排序。


范例:

    <ivy:buildlist reference="build-path">
      
<fileset dir="projects" includes="**/build.xml"/>
    
</ivy:buildlist>

    构建一个build.xml文件列表,根据在相同级别上找到的ivy.xml文件(ivyfilepath的默认值是ivy.xml)来排序。

    然后这个列表可以像这样被使用:

    <subant target="build" buildpathref="build-path" />

    
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" reverse="true">
      
<fileset dir="projects" includes="**/build.xml"/>
    
</ivy:buildlist>

    构建一个build.xml文件列表,根据在这些构建文件相对的ivy目录下找到的ivy.xml文件(ivyfilepath的默认值是ivy.xml)来排序。列表被从最多依赖到最少排序。

    <ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" root="myapp">
      
<fileset dir="projects" includes="**/build.xml"/>
    
</ivy:buildlist>

    构建一个build.xml文件列表,根据在这些构建文件相对的ivy目录下找到的ivy.xml文件(ivyfilepath的默认值是ivy.xml)来排序。仅有是myapp的依赖的模块(不管是直接还是间接)的build.xml被放置在结果列表中。

    <ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" leaf="mymodule">
      
<fileset dir="projects" includes="**/build.xml"/>
    
</ivy:buildlist>

    构建一个build.xml文件列表,根据在这些构建文件相对的ivy目录下找到的ivy.xml文件(ivyfilepath的默认值是ivy.xml)来排序。仅有是依赖mymodule的模块(不管是直接还是间接)的build.xml被放置在结果列表中。

posted on 2009-08-02 09:52 sky ao 阅读(1426) 评论(0)  编辑  收藏 所属分类: project building


只有注册用户登录后才能发表评论。


网站导航: