其他常青藤令牌可用? [英] Other Ivy Tokens Available?

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

问题描述

有没有指定一个解析器常春藤模式时,能够产生下面的输出方式?

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

目前,在[修改]标记解析为完整的4位版本号。我想能够使用修订的前三位为图案的一部分,并使用最后一位为低于子目录。这是可能的,或者我将不得不编写自定义蚂蚁code做到这一点?

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 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天全站免登陆