Andi Vajda <[email protected]> wrote:
>
> On Thu, 3 Nov 2011, Bill Janssen wrote:
>
> > Andi Vajda <[email protected]> wrote:
> >
> >>> Won't specifying "--package javax.imageio" cause all public classes in
> >>> that package to be wrapped? Seems to work that way for java.awt.image.
> >>
> >> No, and it never has. All --package blah does is enable dependencies
> >> in that package to be wrapped as well. If you list no classes that
> >> depend on that package then --package blah is a no-op. --package !=
> >> --jar.
> >>
> >> From the docs in __main__.py:
> >> --package PACKAGE - add PACKAGE to the list of packages from
> >> which dependencies are automatically wrapped
> >>
> >> If you don't list --package blah and you wrap classes that depend on
> >> other classes in that blah package, then all methods with these
> >> dependencies will be skipped.
> >
> > Ah, thanks, that explains it. I am getting ImageIO if I explicitly call
> > it out. The reason I'm seeing java.awt.image.BufferedImage is that
> > GoodStuff explicitly references it.
> >
> > So, let's test my understanding of what classes are selected to be wrapped:
> >
> > * All public classes included with --jar
>
> Yes.
>
> > * All classes from either --include jars or the JRE, which already selected
> > classes depend on, that come from packages included with --package
>
> No. If you --include blah.jar and its package(s) are not listed, then
> classes it contains are not wrapped.
Yes, that was implied by what I meant to say. But if the --include jar
file's packages are listed, they will be wrapped. Is that right?
Perhaps a better way of putting it would be:
* Any classes which otherwise selected classes depend on, *and*
come from a package specified with --package.
> If you want classes in a jar file wrapped, use --jar.
>
> > * All classes from either --include jars or the JRE, which are explicitly
> > specified
>
> No. All classes that are explicitely specified, without any restrictions.
> You can even for a non-public class to be wrapped by listing it explicitely.
So, it should say,
* All classes, public or private, from any source (the JRE, --jar jar
files, or --include jar files, which are the only possible sources)
which are explicitly specified.
Bill
>
> Andi..
>
> >
> > Is that right?
> >
> > Bill
> >
> >>
> >> Andi..
> >>
> >>>
> >>> Bill
> >>>
> >>>>
> >>>> It doesn't look like you asked for the ImageIO class to be wrapped.
> >>>>
> >>>> Andi..
> >>>>
> >>>>>
> >>>>> Everything seems to build just fine, no issues (This is JCC 2.9, Python
> >>>>> 2.6, Ubuntu 10.04, amd64, OpenJDK 6).
> >>>>>
> >>>>> Then to examine the module, I say,
> >>>>>
> >>>>> $ python -c "import goodstuff;
> >>>>> goodstuff.initVM(classpath=goodstuff.CLASSPATH); print dir(goodstuff)"
> >>>>> ['AbstractStringBuilder', 'Appendable', 'Boolean', 'BufferedImage',
> >>>>> 'Byte', 'CLASSPATH', 'CharSequence', 'Character', 'Class',
> >>>>> 'ClassLoader', 'ClassNotFoundException', 'ColorModel', 'Comparable',
> >>>>> 'ConstVariableDescriptor', 'DataBuffer', 'Double', 'Enumeration',
> >>>>> 'Exception', 'FinalizerClass', 'FinalizerProxy', 'Float', 'GoodStuff',
> >>>>> 'IllegalAccessException', 'IllegalArgumentException', 'Image',
> >>>>> 'ImageConsumer', 'ImageObserver', 'ImageProducer', 'IndexColorModel',
> >>>>> 'InstantiationException', 'Integer', 'InterruptedException',
> >>>>> 'InvalidArgsError', 'Iterator', 'JArray', 'JArray_bool', 'JArray_byte',
> >>>>> 'JArray_char', 'JArray_double', 'JArray_float', 'JArray_int',
> >>>>> 'JArray_long', 'JArray_object', 'JArray_short', 'JArray_string',
> >>>>> 'JCCEnv', 'JCC_VERSION', 'JObject', 'JavaError', 'Long', 'Number',
> >>>>> 'NumberFormatException', 'Object', 'Package', 'PrintWriter', 'Raster',
> >>>>> 'RenderedImage', 'RuntimeException', 'SampleModel',
> >>>>> 'SecurityException', 'Short', 'StackTraceElement', 'String', 'Stri
ng
> > Bu
> >>> ffer
> >>>>> ', 'StringBuilder', 'StringWriter', 'Throwable', 'TileObserver',
> >>>>> 'VERSION', 'WritableRaster', 'WritableRenderedImage', 'Writer',
> >>>>> '__builtins__', '__dir__', '__doc__', '__file__', '__name__',
> >>>>> '__package__', '__path__', '_goodstuff', 'findClass', 'getVMEnv',
> >>>>> 'initVM', 'os']
> >>>>>
> >>>>> There's no ImageIO.
> >>>>>
> >>>>> Any ideas? I see no C++ code generated for the javax package, either:
> >>>>>
> >>>>> /tmp/build/_goodstuff:
> >>>>> total used in directory 1248 available 11434880
> >>>>> drwxr-xr-x 3 root root 4096 2011-11-02 09:51 .
> >>>>> drwxr-xr-x 9 root root 4096 2011-11-02 09:51 ..
> >>>>> -rw-r--r-- 1 root root 51101 2011-06-28 16:44 functions.cpp
> >>>>> -rw-r--r-- 1 root root 705 2011-11-02 09:53 goodstuff.cpp
> >>>>> -rw-r--r-- 1 root root 1147 2011-11-02 09:53 GoodStuff.h
> >>>>> -rw-r--r-- 1 root root 9441 2011-11-02 09:53 __init__.cpp
> >>>>> -rw-r--r-- 1 root root 30824 2011-06-28 16:44 JArray.cpp
> >>>>> drwxr-xr-x 6 root root 4096 2011-11-02 09:53 java
> >>>>> -rw-r--r-- 1 root root 21968 2011-06-28 16:44 jcc.cpp
> >>>>> -rw-r--r-- 1 root root 27892 2011-06-28 16:44 JCCEnv.cpp
> >>>>> -rw-r--r-- 1 root root 6093 2011-06-28 16:44 JObject.cpp
> >>>>> -rw-r--r-- 1 root root 18386 2011-06-28 16:44 types.cpp
> >>>>> -rw-r--r-- 1 root root 1076444 2011-11-02 09:53 __wrap__.cpp
> >>>>>
> >>>>> Bill
> >>>
> >
> > repl: bad addresses:
> > [email protected] Andi Vajda <[email protected]> -- junk
> > after local@domain (Andi)
> >
repl: bad addresses:
[email protected] Andi Vajda <[email protected]> -- junk
after local@domain (Andi)