Java Build System
Published on 30 Jan 2005Tags #Java
This Java build system is based on ant
. It comes with a build.xml
that contains project configuration variables. This file includes include.xml
that defines the available targets.
Changelog:
- 20040522: No need for empty args property for targets test and run anymore, support for Java 1.5
- 00000000: Initial release
How to use this build system:
- Unpack the archive
- Customize
build.xml
- Execute
ant init
- Place your sources in
src/
- You are ready to go
The directory structure that will be imposed on your project:
-
src/
Source files -
bin/
Object files with debugging symbols -
lib/
Object files without debugging symbols -
dist/
Files for distribution -
doc/
Project documentation -
api/
API documentation
The targets that are available to you:
-
init
: Initializes the directory structure -
build
: Compiles the sources insrc/
with debugging symbols and places the objects inbin/
-
rebuild
: Removesbin/
and calls thebuild
target -
api
: Generates the API documentation -
test
: Executes the objects frombin/
. You may specify theargs
property which contains command line arguments:ant test
ant -Dargs="blarg" test
ant -Dproject.main="package.class" -Dargs="blarg" test
-
dist
: Calls targets:dist-build
,dist-src
,dist-doc
,dist-bin
,jar
,checksum
-
dist-build
: Compiles the sources insrc/
without debugging symbols and places the objects inlib/
-
dist-src
: Creates an archives for the distribution of the sources -
dist-doc
: Creates an archive for the distribution of the documentation -
dist-bin
: Creates an archive for the distribution of the objects and documentation -
jar
: Creates a jar file from the objects indist/
-
checksum
: Creates MD5 checksums for all files indist/
-
run
: Executes the JAR file. The same applies as for thetest
target -
clean
: Removesbin/
andlib/
-
distclean
: Removesdist/
-
proper
: Calls theclean
target and removesdoc/api/
Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.