ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Quinn <carl.qu...@gmail.com>
Subject Possible issue in LatestVersionMatcher.needModuleDescriptor
Date Wed, 10 Feb 2010 03:44:13 GMT

While tracking down some unexpected behavior in our Ivy-based build system, I
ran across what looks like a bug in
LatestVersionMatcher.needModuleDescriptor(). In that method, it has a
hard-coded check for "latest.integration" to determine when to not require a
module descriptor. 

    public boolean needModuleDescriptor(ModuleRevisionId askedMrid,
ModuleRevisionId foundMrid) {
        return !"latest.integration".equals(askedMrid.getRevision());
    }

In our case, we have redefined our status to be the maven-like:

    <statuses default="snapshot">
        <status name="release" integration="false"/>
        <status name="snapshot" integration="true"/>
    </statuses>

And this LatestVersionMatcher then fails to allow "latest.snapshot" to grab
artifacts w/o module descriptors. (all those old jars that I haven't
Ivy-fied yet :)

I'm not that familiar with the Ivy source, but is there a way for this class
to get the lowest priority status instead of hard coding it? Something like:

    public boolean needModuleDescriptor(ModuleRevisionId askedMrid,
ModuleRevisionId foundMrid) {
        List statuses = StatusManager.getCurrent().getStatuses();
        Status lowest = (Status) statuses.get(statuses.size() - 1);
        String latestLowest = "latest." + lowest.getName();
        return !lowest.isIntegration() ||
!latestLowest.equals(askedMrid.getRevision());
    }

thanks,
--carl

-- 
View this message in context: http://old.nabble.com/Possible-issue-in-LatestVersionMatcher.needModuleDescriptor-tp27525855p27525855.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message