curl-library
Re: packaging
Date: Tue, 2 Jun 2009 08:29:51 +0000 (UTC)
On Tue, 02 Jun 2009 09:00:44 +0200, Daniel Stenberg wrote:
> On Tue, 2 Jun 2009, Thufir wrote:
>
>> is there a reason that the Java classes don't belong to a package?
>
> I now assume you speak about a java binding to libcurl.
Yes, I believe so.
> All the bindings to libcurl for all languages except the "native" C one
> are products and projects that are written and maintained outside of the
> core cURL project. There are well over 30 different ones at this time.
> Some are very advanced and capable, while some are very barebones and
> rough.
>
> They all make their own packages and releases of their projects. I don't
> think the java one is any different. Just make a package and put it
> somewhere. If you tell us about it we can link to it from the
> libcurl/java page on the curl site.
>
> From what I know, some people have tried to get a "javacurl" project in
> the past at several occasions but none of the efforts ever took off
> particularly well. The 'javacurl' project at sourceforge being one such
> example.
Ah, right.
> I think it makes the most sense to do the binding work within a context
> of people who use the language you're doing the binding for. In this
> case that would be java people. You don't typically find that kind of
> people here, on this list.
Ok, I understand that this isn't a Java list :)
I'm not entirely sure that I follow the other aspects of your reply. the
Java code seems to invoke curl.h, from the comments, which is fine. So,
in a sense, it's just a wrapper to provide an API for Java?
Specifically,
[thufir_at_arrakis Desktop]$ tar -xf curl-java-0.2.3.tar.gz
[thufir_at_arrakis Desktop]$
[thufir_at_arrakis Desktop]$ head -n 13 curl-java-0.2.3/MakeCurlGlue.java
/*
** Ugly hack from a Java newbie to fetch the curl defines from the
** curl.h header for creating a list inside the CurlGlue JNI class.
** Reads a preprocessed compiler output from STDIN and parses with
** a regex for the wanted defines, then writes them to STDOUT.
** Initial version 2008-01-26 hacked by Guenter.
**
** $Id: MakeCurlGlue.java 42 2008-10-20 09:27:21Z patrick $
*/
import java.io.*;
import java.util.regex.*;
public class MakeCurlGlue
[thufir_at_arrakis Desktop]$
between the import statements and class declaration generally there's
generally a package declaration, as:
package net.gknw.curl;
I'm no Java expert, but by not specifying a package, effectively putting
classes into the default package, seems to make it difficult to import
these classes and use the API (at least for my skill level).
Specifically, looking at Test.java, there are no import statements (or,
rather, they're commented out).
Perhaps I'll look into checking out the Java bindings from CVS and tweak
them a bit, I think it simply needs a package declaration.
-Thufir
Received on 2009-06-02