I need a bit of advice around best practices for upstream Java
builds. In particular, if/how/where system-specific Java
properties should be set, and how to avoid hard-coding them in
build files. Specifically, the platform.home property, but also
a couple of package-specific ones.

Context for this is some extensions for DocBook XSLT stylesheets,
written in Java, that are maintained by the DocBook Project. We
(the DocBook Project) plan to release those as separate upstream
package, but they are also currently bundled with the upstream
docbook-xsl package (which is the package containing the actual
XSLT stylesheets themselves). There was some discussion about
those packages on this list a few months back[1].

[1] http://lists.debian.org/debian-java/2007/02/threads.html#00039

The source for the package includes some Netbeans project files
with property settings; for example:

  
https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/xsl-java/saxon65/nbproject/project.properties

Notice in that file that is there is a hard-coded value set for
the file.reference.saxon.jar, which is a system-specific setting
(it's the location of the saxon.jar file needed for the build). We
could have just as well omitted it (and required it to be set
somewhere else in the environment) but it's there to remind the
project developers that the need to (re)set it to the appropriate
path on their systems. There is a similar hard-coded setting in
the project.properties file for the Xalan version of the extensions.

When I build the actual upstream package, I override those
settings by using an ~/.antrc with the following content:

  ANT_OPTS="$ANT_OPTS \
   -Dfile.reference.saxon.jar=/usr/share/java/saxon-6.5.5.jar \
   -Dfile.reference.xalan.jar=/usr/share/java/xalan-2.7.0.jar \
   -Dplatform.home=/usr/lib/jvm/java-6-sun"

So my question is, is that an appropriate way to expect other
users (users who want to build the upstream package themselves
from source) to set the properties, or is there some other more
portable "best practice" way of going about it?

I realize that for the Debian package, the Debian packager can
just hard-code Debian-specific system values for those, but I'm
asking in the context of how to make the upstream package as
portable/ easily buildable as possible.

  --Mike

-- 
Michael(tm) Smith
http://people.w3.org/mike/
http://sideshowbarker.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to