[armedbear-devel] [OT] best way to structure and deploy a project

Alessio Stalla alessiostalla at gmail.com
Mon Aug 24 15:14:04 UTC 2009


Hello everyone,

I have a question which is not exactly pertinent with the development
of ABCL, but which imho can start a useful discussion. Please forgive
me if this is too OT.

I have a project with sources in two languages, Java and Lisp. It is
an Eclipse project, but the IDE does not make difference. The project
is a library, not an end-user application.

Currently it is structured as follows:

src/java - Java source code
src/lisp - Lisp source code
lib/ - third-party libraries, both Java (jars) and Lisp (directories).

The Java code is compiled by the IDE and put in an output directory.
The Lisp source files are treated by the IDE as normal, non-source
files, and copied verbatim into the same ouput folder as the Java
classes.

When I run the project from the IDE, I launch a class which compiles
and loads the Lisp systems using asdf. This works for me locally, but
thinking about distributing the project to users, this approach has
some drawbacks:

- Lisp files must be true files, they can't be in a Jar (asdf doesn't
understand jars).
- Lisp files are recompiled every time, since the IDE always
overwrites the Lisp source files in the output directory.
- If I make a jar, it will contain Lisp source files, not binaries,
since binaries are unknown to the IDE.

Ideally I'd like to do what ABCL does, i.e. create one big jar
containing .class files and compiled Lisp files. Lisp sources could be
compiled by the IDE or by a script, I don't care. Still, I would like
to maintain the use of asdf (since some of my dependencies use it and
loading them manually is too much of a hassle). I don't know how I can
do this.

I have also thought about leaving everything as-is, and when I'll
distribute the library as a jar, have it extract at runtime the Lisp
source files from the jar in a temporary directory and instruct asdf
to search for systems in that directory. I will also need the lib/
folder to be in a known place, since asdf has to load stuff from there
too (but this is less of a problem since I can make the library user
configure that place, and use a sensible default otherwise). I am
wondering if a cleaner approach exists, and if someone has experience
in this regard.

Cheers,
Alessio




More information about the armedbear-devel mailing list