sviperll / adt4j

adt4j - Algebraic Data Types for Java
BSD 3-Clause "New" or "Revised" License
143 stars 8 forks source link

Shade all implementation dependencies #23

Closed jbgi closed 8 years ago

jbgi commented 9 years ago

possibly with maven shade plugin. This avoid wrong imports of stuff that won't be there at runtime. Google autovalue does it: https://github.com/google/auto/blob/master/value/pom.xml I suggest using a shadedPattern prefix in the lower end of the alphabet, like "zzz_adt4j.shaded." edit: or even better use this fork of maven shade plugin :https://github.com/immutables/tools#1-relocation-with--uglyfication.

sviperll commented 9 years ago

Why is it better to use zzz_adt4j.shaded instead of something like com.github.sviperll.adt4j.shaded? Why uglification?

Do we really need shading? I think maven dependencies work good enough, and adt4j has quite a few of them.

jbgi commented 9 years ago

the idea was that if the package starts with zzz then classes from this package would show up last in the ide completion list: I never want to use any class from adt4j dependencies transitively (at4j and its dependencies won't be there at runtime). Another problem that might arise if we don't shadow is dependency conflicts between the project own compile dependencies and the one from adt4j or between ad4j dependencies and any other annotation processors that might depends, eg., on a different/incompatible version of jcodemodel. And since classpath is shared between all annotation processors...

sviperll commented 8 years ago

New artifact adt4j-shaded is now provided that should have no dependencies.