openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damjan Jovanovic <>
Subject Building Java code: Ant improvements, and better IDE integration
Date Wed, 09 Aug 2017 17:50:42 GMT

Building AOO's Java code is currently mostly done with dmake and gbuild.
Both are ugly, unsupported by Java IDEs, and impossibly problematic with
some development I've been doing, so I began looking for an alternative.

It turns out we also have Ant, which is well established, supported by most
Java IDEs, and already a build requirement for AOO. But it's not that
widely used in AOO at the moment, only called from dmake, and used in a
very ugly way: dmake passes lots of properties to Ant to specify build
settings and paths to dependencies, making the build.xml file useless
without dmake - when Eclipse opens it, the dependencies are missing, as the
properties they would be in aren't set.

So I was thinking, why does Ant have to go through dmake? Can't it work out
settings from the ./configure output the way dmake and gbuild do?

Apparently, it can! As of revision 1804591, I've changed main/
to also write variables into a main/ file, in addition to the
usual main/ (which we "source"). The Ant project's
build.xml can then include this file (eg. using <property
file="../"/>), and have available all the properties that
normally exist as environment variables. It can then use those properties
to work out build settings and paths to dependencies.

This means:
1. No "source" is necessary for Ant to work.
2. Ant operates independently and can build that individual project by
itself, without being called from a parent build tool like dmake.
3. (At least) Eclipse can now cleanly open the Ant build.xml, find all the
JARs it depends on, and successfully compile the project :-).

The only minor problem is that Eclipse writes the .class files into a
"build" directory in the project instead of the module's output directory
where Ant does, but that's probably because the module output directory
isn't a subdirectory of the project directory.

I've only changed main/connectivity/java/sdbc_hsqldb uses these Ant
improvements for now, but I plan to add more.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message