Help for Antiplate

Antiplate is a project-template for typical java-projects. It needs an installed ant and creates build-scripts, that can execute standard-targets.

requirements

Antiplate needs an Ant-Installation with a version at least at 1.6. Additionally an JDK is needed. All features of Antiplate can be used only with a Java-5-JDK, but many features work with versions before that.

seeding a project

Go to the Antiplate-directory and execute ant seed. The scripts now asks you some questions about your project.

* Specify the starting-directory (the project-dir will be a subdirectory of this). -> Here you must input the base-directory, in that the project-directory will be created.

* Specify the name of the project (it's also the name of the directory). -> Here you specify the projectname that becomes also the name of the project-directory. Example: You answer in the first question '/home/projects' and in the second question 'MyProject'. The projectdir will become '/home/projects/MyProject'.

* Specify a short description of the project. -> This description will become part of the generated buildfile and will be outputted on 'ant -p'.

* Specify the (fully qualified) main class to start the application developed by this project. Leave empty to disable starting. -> You can define here a fully qualified class-name with a main-method (i.e. myproject.main.MainClass). This class will be executed on 'ant start', 'ant start-dist' later in your generated project. If you leave this empty, than is starting of your project disabled.

* Specify the default target. Leave empty for no default-target. (,all,clean,compile,compile-all,dist,dist-all,doc,doc-all,start,test) -> Here you specify, which target will be default in your project.

* Specify the used Java-Version. It will be used for compiling to the specified JVM and with the features of the JVM enabled. (1.3,1.4,1.5) -> This entry is used as the source-parameter for javac.

After answering these question, your inputs will be displayed and you will be asked for confirmation. If you confirm this the new project will be created.

directory-structure

Antiplate uses the following directory-structure:

+ <projectname>

++ src Here are the source-files for the project.

++ test Here are the sources for the junit-tests.

++ lib This directory contains libraries (.jar-files).

+++ lib/std Drop here libraries, that are needed for runtime of the project.

+++ lib/test Drop libraries, that are needed for the execution of junit-tests.

+++ lib/ant Antiplate has dropped here libraries, that are needed for the execution of the buildscripts.

++ inc Here are additional includes.

+++ inc/jar Files in this directory are added to the classpath and the generated jar-file. The path under this directory becomes the path in the classpath.

+++ inc/test Files in here are added to the classpath for the execution of junit-tests.

+++ inc/dist Files, that are added to a binary distribution. The directory-structure will be also used in the distribution.

++ conf Configuration for the project.

++ generated Antiplate put all generated files in this directory.

+++ generated/doc The generated documentations.

+++ generated/dist The generated distributions.

++ build.xml The main buildfile.

After seeding a new project, only the directories conf and lib and the file build.xml are existing. Other directories will be created automatically in the execution of the appropiate task. The src- and the test-directory must be created and source-files must be put in it.

Targets

The newly created projects have some standard-targets for typical work in a java-project. You can get a complete list with the execution of 'ant -p'.

Compiling

In the newly created project existing targets for compiling the source-code. If you execute 'ant compile' the sources are compiled. 'compile-test' compiles the sources of the junit-tests.

Starting

There are some targets for executing the project.

'ant start' executes the defined main-class. The main-class ist defined in the build.xml in the property start. It contains first the value you have given in seeding the project, but the value can be changed. It must contain the fully-qualified class-name of the main-class, that should be executed (i.e. myproject.main.MainClass).

'ant start-dist' executes the main-class in the same way, a distribution would do it.

Testing

With 'ant test' you can execute the junit-tests for this project. It takes the sources for the tests from the directory test and executes all TestCases, where the classname ends in 'Test'. So 'myproject.test.MyTest' gets executed, but not 'myproject.test.TestAllStuff'.

Because this taret uses jUnit 4 it needs for execution at least Java 1.5.

Distribution

Some targets creating standard-distributions.

'ant dist' creates a binary distribution of the project. It creates the project-directory and packs it in .zip, .tar, .tar.gz and .tar.bz-files. The files will be dropped into generated/dist.

'ant dist-jar' creates a jar-file with the compiled sources, good for distributing the project as a library.

'ant dist-src' creates a source-distribution. It needs Subversion or CVS.

Documentation

'ant doc' creates the javadoc for the sources. They are generated into generated/doc.

'ant-report' generates some reports about the project.

Cleaning

'ant clean' deletes generated files and old backups.

Updating

With 'ant antiplate-update' the project will use the actual Antiplate-scripts.