Ringlord Technologies Products


AntBuilder is for those who are not using an IDE or another tool to handle the build and packaging process. I'm a bit old school. I like my software to build without any dependencies on a particular environment: I invoke ant from gnuemacs and step through compilation errors with prev-error and next-error commands bound to keystrokes. It's fast, simple, and works anywhere, even on the console.

But this isn't about how I work, or why. AntBuilder is the tool I use to create and maintain the Ant build.xml file for my projects. Maybe you find it useful, too. Here is what the build.xml offers in command line options:

ant -p
Displays all the targets you can use (Ant will do this for any of its scripts; AntBuilder merely ensures that the right targets are visible this way);
ant all
Builds everything from a clean start;
ant compile
Compiles what needs changing;
ant jar
Builds the JAR for your project;
ant jar4, ant jar5, ant jar6, jar7, and jar8
Builds the JAR for your project based on a particular target (Java 1.4, Java 1.5, Java 1.6, Java 1.7, or Java 1.8), each able to refer to a different runtime (rt.jar) to ensure that you find out during compilation whether your software will actually run on the destination platform;
ant docs
Builds the JavaDoc for your project;
ant dist
Builds a distributable package containing your software and, optionally, source code, documentation, and miscellaneous files;
ant gitlog
Generates a changelog from the output of the 'git log -M --namestatus' command.
ant svnlog
Generates a changelog from the output of the 'svn -v -r HEAD:1' command.

AntBuilder saves your settings in a hidden file (.antbuildrc) in the current directory and reads them again when you decide to change what the build.xml file contains.

AntBuilder writes the build.xml file as _build.xml, requiring you to rename it or copy it over your existing build.xml file; it will never destroy your existing build.xml but you can test the temporary file with ant -f _build.xml

The build.xml that AntBuilder generates can either reference external libraries in the Class-Path field of the JAR's manifest, or repackage (extract/transfer) the contents of libraries into your own JAR for delivery of a single JAR without external dependencies.

You can optionally have AntBuilder create Swing (Java 1.5+) or JavaFX (Java 1.8+) skeleton source code to get you started.

Note, if you are looking to package JAR files within your JAR, without extracting the contents of the nested JARs or referencing them as external dependencies, but really and truly hosting them unchanged inside your JAR as if the JAR were a file system, then you should have a look at JarClassLoader for what looks like a superb piece of software that does just that. JarClassLoader is licensed under the GPLv2.

Note: AntBuilder 1.20+ alters some ways that JAR files are packaged. In particular the contents of the etc/ and help/ directories no longer lose the top-level (etc/ and help/) directory name in the JAR which means you will have to prefix the names of resources appropriately or they will not be found in their subdirectories. Changes were also made to some of the options and how they are processed. Check the two main panels to see that all looks good. And last, the default options are mostly unchecked, and the default source/target versions default to the Java version you’re actually running.

Description:A Java tool to construct a build.xml file for Ant. If nothing else, this is a great way to get started with a project. We use this all the time!
License:Free as in Beer
Requirements:Java 1.5+
Launch (shell):java -jar antbuilder.jar
Download:antbuilder.jar (77.0KiB)
Documentation:antbuilder.odt (41.4KiB)
antbuilder.pdf (169.9KiB)

All content is copyright © Ringlord Technologies unless otherwise stated. We do encourage deep linking to our site's pages but forbid direct reference to images, software or other non-page resources stored here; likewise, do not embed our content in frames or other constructs that may mislead the reader about the content ownership. Play nice, yes?

Find something useful here? Maybe donate some Bitcoin!