On Mon, Sep 24, 2012 at 5:24 PM, Eric Czech <[email protected]> wrote:
> Thanks Ron but no unfortunately, they're not upwards compatible.
> Entire classes are renamed or removed in later versions so artifacts
> using the old version definitely can't just use the new one.

Only for @Beta classes/methods (which you shouldn't use in a library /
code designed to be reused by others) or after a 18-months deprecation
notice: 
https://code.google.com/p/guava-libraries/wiki/PhilosophyExplained#Iteration.
It might be that r09 didn't follow those rules though… (note that r09
is almost 18 months old, so if a project depends on r09 and used
things that were deprecated in that version, it could very well no
longer run with 13.0.1)

> Having our own guava artifact with the code from 13.0.1 means that we
> can use that version *internally* and external libraries can use
> whatever version they are specified as needing.
>
> Shading definitely seems like a better generic way to deal with this
> but I'm still not totally sure how to do it.
>
> Stephen, by intermediate modules do you mean create projects for each
> guava version, add the guava version as a dependency, give it a unique
> shading, and then point all dependent projects at those "intermediate"
> projects instead of directly at the guava artifacts?

I believe he meant creating an "intermediate project A" module that
depends on "project A" and relocates guava r09, so that it doesn't
conflict with your own use of Guava (13.0.1) in "project B" (which
would obviously depend on "intermediate project A" instead of "project
A".
The "intermediate project A" artifact would contain both "project A"
classes modified to reference relocated Guava classes, and the
relocated Guava classes. Other dependencies could be left as
transitive dependencies.

Or you could create a "relocated Guava" module for your own use. I'd
rather go with the former though, as the conflicts could potentially
be resolved when updating "project A", in which case you simply remove
the "intermediate project A" so that both "project A" and "project B"
code use the same Guava version, and you don't have to change your
code.

-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to