Sky's blog

我和我追逐的梦

常用链接

统计

其他链接

友情链接

最新评论

ivy中文参考文档(18)-ant任务(6)-deliver

1) deliver

    交付当前模块的解析好的描述符,而且可能执行依赖的递归交付。
   
    这个任务主要做两个事情:

    1. 生成一个解析好的ivy 文件

    这个任务生成一个当前模块的解析好的描述符,基于最后一次解析。解析好的ivy文件包含交付的模块的已更新信息,例如修订版本和状态。

    此外,所有被包含的配置的文件将包含在ivy文件中,而且变量被他们的值替代。

    最终,在解析好的ivy文件中,动态修订版本被在解析过程中找到的静态的修订版本替换,因此这些ivy文件后面可以安全的使用来获得相同的依赖(前提条件是修订版本唯一的标识一个模块,这是ivy正常使用的基础)。

    从1.3起 动态修订版本被静态修订版本的替换可以被关闭,因此动态修订版本被保留在ivy文件中。这对于发行的模块描述符是完全解析好的推荐标准是一个例外,所以请小心使用。

    2. 执行递归交付

    仅在delever target被设置给delever任务时才这样做。

    如果delever target被设置,则为每个和这个任务设置的delever状态对比没有suffisant状态的依赖,它会被调用(通过antcall)。这意味着如果你交付一个集成修订版本,递归交付不会进行。

    如果你交付一个里程碑或者发行修订版本,delever target将和每个集成依赖一起被调用。

    delever target被调用时有下面的属性可用:
  • dependency.name
  • 递归交付的依赖的名称
  • dependency.published.status
  • 将交付的依赖的状态
  • dependency.published.version
  • 将交付的依赖的修订版本
  • dependency.version
  • 将交付的依赖的修订版本
    dependency.published.status和dependency.published.version 要求用户通过ant输入任务给出(默认行为),或者对于整个递归交付过程总是相同,如果下列属性被设置:

  • recursive.delivery.status
  • 设置被要求交付的所有依赖的状态
  • recursive.delivery.version
  • 设置被要求交付的所有依赖的版本
    通常交付任务自身引发另外一个ant build(使用ant 任务),虽然这取决于你。
    交付的ivy文件将使用那些在这里给出的更新它的依赖的修订版本。

2) deliver和publish

    交付任务大多数情况下并不显式调用,而且通过publish任务自动调用。因此,什么时候应该显示的调用deliver任务呢?当你真正需要区分什么是deliver任务产生的,什么是publish任务产生的时候。或者说,上传一个模块到仓库。

    如果你想在上传之前处理产生的ivy文件(如果你想自动添加更多信息如使用SCM 标签,执行release的用户,...),这将非常有用。

    如果你想触发一个递归交付并保证你如依赖一样得到递归交付的模块,它也将有用。在这种情况下你的构建的顺序可能像这样:

- ivy:configure
- ivy:resolve
- ivy:deliver with recursive delivery
- ivy:resolve again with the ivy file generated by the recursive delivery
- do your build stuff (compile, jar, whatever)
- ivy:publish

3) 属性

属性描述必要
deliverpattern ivy文件交付时使用的正则表达式
不,默认为${ivy.deliver.ivy.pattern}
pubrevision 发布时使用的修订版本
不,默认为${ivy.deliver.revision}如果设置了,或者解析好的修订版本如果设置了,或者时间戳
pubbranch the branch to use for the publication
发布时使用的分支
不,默认为${ivy.deliver.branch}如果设置了,或者解析好的分支如果设置了,或者没有(分支信息将不被更新)
pubdate the publication date to use for the publication. This date should be either 'now', or a date given with the following pattern: yyyyMMddHHmmss
No. Defaults to 'now'
status the status to use for the publication No. Defaults to ${ivy.status}
delivertarget the target to call for recursive delivery No. No recursive delivery is done by default
validate true to force ivy files validation against ivy.xsd, false to force no validation No. Defaults to default ivy value (as configured in configuration file)
replacedynamicrev true to replace dynmic revisions by static ones in the delivered file, false to avoid this replacement (since 1.3) No. Defaults to true
settingsRef A reference to the ivy settings that must be used by this task (since 2.0) No, 'ivy.instance' is taken by default.
conf comma-separated list of configurations to include in the delivered file. Accepts wildcards. (since 2.0) No. Defaults to all configurations
generateRevConstraint true to automatically generate a 'revConstraint' attribute in the deliverd file (see the dependency page for more info about this attribute), false to never generate this attribute (since 2.1.0) No. Defaults to true


4) 例子

    交付一个ivy文件,不使用private设置:
    <deliver conf="*(public)" />

posted on 2009-08-31 22:22 sky ao 阅读(1293) 评论(0)  编辑  收藏 所属分类: project building


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


网站导航: