ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Jacobsson <anders.jacobs...@gmail.com>
Subject Re: Customized revision scheme
Date Wed, 10 Mar 2010 07:13:10 GMT
Hi!

Sure, here is what I have tried to do:

I have implemented my own last strategy that looks the same as
LatestRevisionStrategy except that the MridComparator compares two
R-releases to determine which one is the latest. The strategy is plugged in
as follows:

  <typedef name="latest-product-revision"
classname="com.bla.bla.build_utils.ivy.LatestProductRevisionStrategy"/>
  <latest-strategies>
    <latest-product-revision name="latest-product-revision"/>
    <latest-revision name="latest-revision"/>
  </latest-strategies>

The above is used by my conflict managers:

  <conflict-managers>
    <latest-cm name="latest-conflict-manager" latest="latest-revision"/>
    <latest-cm name="latest-product-revision-conflict-manager"
latest="latest-product-revision"/>
  </conflict-managers>

However, I do not believe that the conflict managers are actually used as
there are no revision conflicts.

The resolvers are also using the latest strategies:

  <resolvers>
    <url name="bla-release" latest="latest-product-revision">
        <ivy pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-releases-local/[organization]/[module]/[revision]/ivy-[revision].xml"/>
        <artifact pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-releases-local/[organization]/[module]/[revision]/[artifact]-[revision]-[type].[ext]"/>
    </url>
    <url name="bla-latest-integration" checkmodified="true"
latest="latest-product-revision">
        <ivy pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-snapshots-local/[organization]/[module]/[revision]/ivy-[revision].xml"/>
        <artifact pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-snapshots-local/[organization]/[module]/[revision]/[artifact]-[revision]-[type].[ext]"/>
    </url>
    <url name="bla-release-publish" latest="latest-product-revision">
        <ivy pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-releases-local/[organization]/[module]/[revision]/ivy-[revision].xml"/>
        <artifact pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-releases-local/[organization]/[module]/[revision]/[artifact]-[revision]-[type].[ext]"/>
    </url>
    <url name="bla-latest-integration-publish"
latest="latest-product-revision">
        <ivy pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-snapshots-local/[organization]/[module]/[revision]/ivy-[revision].xml"/>
        <artifact pattern="http://
${repository.host}:${repository.port}/${repository.baseUrl}/libs-snapshots-local/[organization]/[module]/[revision]/[artifact]-[revision]-[type].[ext]"/>
    </url>
    <ibiblio name="libs-releases" m2compatible="true"
root="http://${repository.host}:${repository.port}/${repository.baseUrl}/libs-releases"
latest="latest-revision"/>
  </resolvers>

I am using Artifactory as a repository server. libs-releases is used for
third party libraries while libs-releases-local and libs-snapshots-local are
used for our internal releases and snapshots.

The modules look like:

  <modules>
    <module organisation="com.bla.bla.*" revision="latest.integration"
resolver="bla-latest-integration"
conflict-manager="latest-product-revision-conflict-manager"/>
    <module organisation="com.bla.bla.*" resolver="bla-release"
conflict-manager="latest-product-revision-conflict-manager"/>
    <module resolver="libs-releases"
conflict-manager="latest-conflict-manager"/>
  </modules>

I have also tried to implement my own version matcher but if I have
understood it correctly, that would only be necessary if I would like to do
things like R1A+, R[1,2]A. Correct? Also, I was hoping that the
out-of-the-box version matchers (i.e. ExactVersionMatcher and
LatestVersionMatcher) would suffice when it comes to exact matching and
latest.* matching. But I have to admit that I have not really grasped how
version matchers come into play.

And finally, I made my own implementation of the buildnumber ant task for
two reasons. One, I wanted to add zero padding to the build number and two,
the default implementation is hardcoded to use latest-revision as latest
strategy.

But regardless of the above, it seems like Ivy is unable to resolve the
following dependency

      <dependency org="com.bla.bla.scf" name="a2" rev="latest.integration"
conf="runtime->api"/>

although a snapshot of a2 is available (e.g. R1A-SNAPSHOT (it works
perfectly when the revision is 1.0-SNAPSHOT)). The infos (array of
ArtifactInfo) passed to the sort method of my latest strategy implementation
does not contain anything. Perhaps I need to implement my own resolver?

Sorry for the long mail.

Cheers,
Anders


On Tue, Mar 9, 2010 at 4:59 PM, Mandie Smith <mandie@houseofgnomes.net>wrote:

> Could you post an example of what you've done?
>
> Mandie
>
> On Tue, Mar 9, 2010 at 8:26 AM, <anders.jacobsson@gmail.com> wrote:
>
> > Hi!
> >
> > My company is using a different revision scheme that I would like to
> > configure Ivy to honor. The format is as follows:
> >
> > R[major][minor][build (optional)] where major denotes new functionality,
> > minor corrections and build is an internal sequence
> >
> > Example: R1A01 (which would correspond to 1.0-1 or something)
> >
> > Not sure if it has any impact but I still want to be able to use
> > 'latest.integration' etc (or use some other name if that is necessary)
> for
> > snapshot builds, eg R1A-SNAPSHOT.
> >
> > Is it all possible to do this? I have tried to implement my own latest
> > strategy and version matcher but either it is not possible or I am not
> > understanding how Ivy works.
> >
> > Cheers,
> > Anders
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message