其他常春藤代币可用吗? [英] Other Ivy Tokens Available?

查看:30
本文介绍了其他常春藤代币可用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在指定解析器常春藤模式时有没有办法能够产生以下输出?

Is there a way when designating a resolver ivy pattern to be able to produce the following output?

C:/MyRepository/MyCompany/MyModule/1.2.3/4/ivy.xml

目前,[revision] 令牌解析为完整的 4 位版本号.我希望能够将修订版的前三位数字用于模式的一部分,并将最后一位数字用于其下方的子文件夹.这是可能的还是我必须编写自定义蚂蚁代码才能做到这一点?

Currently, the [revision] token resolves to the full 4-digit version number. I'd like to be able to use the first three digits of the revision for a part of the pattern and use the last digit for a subfolder below that. Is this possible or would I have to write custom ant code to do this?

像这样:

<resolvers>
    <filesystem name="myresolver">
        <ivy pattern="${my.dir}/[organisation]/[module]/[shortversion]/[rev]/ivy.xml" />
        <artifact pattern="${my.dir}/[organisation]/[module]/[shortversion]/[rev]/([target])[artifact].[ext]" />
    </filesystem>
</resolvers>

哪里:

${my.dir} = C:/MyRepository/

并且常春藤令牌具有以下值:

and the ivy tokens have these values:

[organisation] = MyCompany
[module] = MyModule
[shortversion] = 1.2.3
[rev] = 4

我意识到我正在编造这些虚构的标记(shortrevision 和 rev),但我希望能够做的是获取修订号部分(主要、次要、构建、修订),以便我可以在模式中使用它们.

I realize I'm making up these fictitious tokens (shortrevision and rev), but what I'd like to be able to do is get at the revision number parts (major, minor, build, revision) so that I can use them in the pattern.

推荐答案

ivy 支持 额外的属性 可以附加到依赖声明如下:

ivy supports extra attributes which can attached to the dependency declaration as follows:

<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
    ..
    <dependency org="MyCompany" name="MyCompany" rev="1.2.3" e:buildnum="4"/>

额外的属性在解析器模式中正常使用,如下所示:

The extra attributes are used as normal within your resolver patterns as follows:

<resolvers>
    <filesystem name="myresolver">
        <ivy pattern="${my.dir}/[organisation]/[module]/[revision]/[buildnum]/ivy.xml" />
        <artifact pattern="${my.dir}/[organisation]/[module]/[revision]/[buildnum]/[artifact].[ext]" />
    </filesystem>
</resolvers>

这篇关于其他常春藤代币可用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆