That idea sounds awesome to me - I may even do it. How would you like such a
thing implemented? As a script? A diff against "regular" httpclient?

Interestingly, for the case of HttpClient-Cache, my original problem would
not be solved by this approach. HttpClient-Cache uses EntityUtils.consume
statically, and there's no way to fix that. Perhaps a simple change to not
use EntityUtils.consume and thus conform to the HttpClient 4.0 API would be
alright? Also, I confirmed with that change, HttpClient-Cache works in
Android (the jar, that is) and the compiled jar only uses HttpClient 4.0
APIs. The unit tests, however, use methods from beyond the 4.0 API and thus
do not run against HttpClient 4.0.


olegk wrote:
> 
> On Thu, Nov 10, 2011 at 11:49:09AM -0800, candrews wrote:
>> 
>> I thought of that, but it won't work when an Android app has dependencies
>> that use HttpClient.
>> 
>> I use Spring Android Rest Template. My goal is to use Rest Template with
>> caching via HttpClient-Cache. If I shade HttpClient (and
>> HttpClient-Cache),
>> and include the shaded jar in my project, then Rest Template will not use
>> it
>> (as it's compiled to use the "real" HttpClient, not my private copy in a
>> new
>> namespace). So now I have to process Rest Template using Maven Shade. I'd
>> also like osmdroid to use the same HttpClient, so I have to shade it
>> too...
>> Now I'm using at least 4 custom created jar's outside of my Android app's
>> ant build system, causing a serious maintenance problem :-)
>> 
>> Is there an ant analogue to Maven Shade? Is there a different approach to
>> solving these problems?
>> 
> 
> There is a way to build a reasonably up-to-date version of HttpClient
> fully compatible with Android: shade impl classes and new interfaces only
> and make them compileable against 4.0 API. That would involve a bit more
> work but result in a library fully compatible with Android and 3rd party
> libraries at the same time.
> 
> If someone were to contribute such a port to the project, we probably
> could even ship it as an official ASF release.
> 
> Oleg
> 
> 
> 
>> (I apologize if I'm hijacking this list inappropriately - IMHO this seems
>> relevant to httpclient-user, and I'm not sure where else to ask. I'll
>> happily shut up if the list maintainer believes this thread is
>> off-topic).
>> 
>> Thanks again!
>> ~Craig
>> 
>> 
>> sebb-2-2 wrote:
>> > 
>> > On 9 November 2011 04:05, candrews <[email protected]> wrote:
>> >>
>> >> Maven Shade isn't compatible with maven-android-plugin:
>> >> https://code.google.com/p/maven-android-plugin/issues/detail?id=170
>> >> Perhaps
>> >> when that is resolved, Shade will be a solution for Maven users. But
>> what
>> >> about Ant users (which I think are what most of the Android apps are
>> >> built
>> >> with)?
>> > 
>> > It would also be possible to use the Maven Shade plugin to create a
>> > version of the HC jars with a different package name.
>> > This would be done independently of any Android build, whether using
>> > Maven or Ant.
>> > 
>> > You then build the Android stuff against the shaded jar, using the new
>> > package names.
>> > 
>> > This is not an ideal long-term solution, but should be sufficient for
>> > prototyping purposes.
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [email protected]
>> > For additional commands, e-mail: [email protected]
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://old.nabble.com/HttpClient-Cache-release-that-works-against-HttpClient-4.0--tp32775131p32821369.html
>> Sent from the HttpClient-User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/HttpClient-Cache-release-that-works-against-HttpClient-4.0--tp32775131p32826896.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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

Reply via email to