frjaeger220 / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Patch: use jarjar in multibindings build.xml #254

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Attached is a patch to extensions/multibindings/build.xml which adds jarjar
to the build process so google-collect-snapshot-20080530.jar is not a
runtime dependency of guice-multibindings.

Since google-collections is already pulled into guice.jar, right now this
results in only one duplicated class, "com.google.common.base.Preconditions".

I suspect this is only temporary until google-collections hits 1.0.

Original issue reported on code.google.com by mark.ren...@gmail.com on 1 Oct 2008 at 8:06

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 2 Nov 2008 at 9:44

GoogleCodeExporter commented 9 years ago
Fixed with r706. I didn't use Mark's patch 'cause that would require multiple 
extra copies of collect.

Original comment by limpbizkit on 29 Nov 2008 at 8:47

GoogleCodeExporter commented 9 years ago
Jesse, I don't think this is fixed. I just checked out r716, did a full clean 
build
and the code still throws the following exception:

java.lang.NoClassDefFoundError: 
com/google/inject/internal/collect/ImmutableMultimap
        at
com.google.inject.assistedinject.Factories$RealInvocationHandler.<init>(Factorie
s.java:220)
[snip]

I have trunk/dist/guice-assistedinject-snapshot.jar and 
trunk/dist/guice-snapshot.jar
in my classpath. I assume these are correct?

Original comment by gili.tza...@gmail.com on 2 Dec 2008 at 7:46

GoogleCodeExporter commented 9 years ago
I suspect there might need more involved -- if I remember Jesse's approach 
correctly, he used JarJar on guice, and then JarJar on each extension, and then 
erased the jarjar creations from each extension.  That'll only work if 
extensions 
only use the same parts of JarJar'd code that Guice uses.  If an extension uses 
something new, it won't see it in Guice's JarJar'd code.

Original comment by sberlin on 2 Dec 2008 at 2:14

GoogleCodeExporter commented 9 years ago
Yup, sberlin is right. This means my clever solution isn't going to work as 
neatly I'd originally hoped. I made a 
quick fix in r717, if anyone has ideas for something more reliable, I'm 
interested.

Original comment by limpbizkit on 2 Dec 2008 at 5:09

GoogleCodeExporter commented 9 years ago
If there's a way to move all jarjar'd extension code into Guice's jarjar'd code 
that
should resolve it.  I can't imagine any of this is going to play nice with 
attempts
to remove unused static dependencies though.

Original comment by sberlin on 2 Dec 2008 at 5:31

GoogleCodeExporter commented 9 years ago
For one, this issue should be reopened :)

Secondly, how about taking this opportunity to provide a build of Guice that 
doesn't
use JarJar (i.e. depends on external jar files)? I'd rather use this in the 
long run
anyway (and use Proguard myself if I need to) but it would also come in useful 
in the
short run until you figure this out.

Original comment by gili.tza...@gmail.com on 2 Dec 2008 at 5:33

GoogleCodeExporter commented 9 years ago
I posted a patch for building Guice without dependencies here:
http://bbs.darktech.org/guice254.patch

Original comment by gili.tza...@gmail.com on 6 Dec 2008 at 9:31