Finding abcl-contrib packages inside a JAR: approach and suggestions

Frederico Munoz fsmunoz at sdf.org
Sat Apr 29 19:48:14 UTC 2017


Hello,

I'm almost done with my small experiment:

* I'm loading lisp code via a Java file using Load.loadSystemFile in an
  init method

* I'm adding the file file to *lisp-home* via gradle

* I'm using gradle tasks to create a single JAR with abcl and
  abcl-contrib added (not as JAR files)

Note that I need to have only one jar file and with specific
requirements around the main method; the above allows me to have it
working fine, a single  JAR which is essentially standalone.

My only remaining doubt (apart from other possible solutions which could
also work and be more elegant, I'm open to suggestions of course) is
around loading abcl-contrib.jar or more specifically the included
packages (JSS and JFLI specifically). I've spent some hours tracking the
loading mechanism and learned a bit about the process but I'm still
missing some pieces.

My current solution (which works) is:

(require :abcl-contrib)
(pushnew (make-pathname :device (pathname-device *lisp-home*) :directory '(:absolute "jss")) asdf:*central-registry*)
(require :jss)

This adds #P"jar:file:/foo/myapp.jar!/jss" to ASDF, but I would like something more direct.

With my setup (system::find-contrib) returns NIL; I've tried to add the
abcl-contrib.jar to myapp.jar (which is in the CLASSPATH of course) but
the code on abcl-contrib.lisp (and specifically find-contrib) doesn't
seem to seach inside a jar for another one. I also tried to use something like

(system::add-contrib (make-pathname :device (pathname-device *lisp-home*) :directory '(:absolute  "abcl-contrib.jar")))

to see if it would pick up the jar but no luck.

I think there is something obvious I'm missing, the pieces are all there
(the jar handling code works fine, etc) but I can't seem to find the
right way to put them together.

Best regards,
-- 
fsmunoz at sdf.org
SDF Public Access UNIX System - http://sdf.org



More information about the armedbear-devel mailing list