How To... Start a Project - Preparation | ![]() |
Directory Structure | ||
Doing a little groundwork in advance will save you alot of time. The Krysalis team believe in making things as easy for you as possible so we have provided a number of skeleton projects for you to use as a starting point.
You can get these project skeletons as a separate download, they are in the Krysalis-Tempaltes module. At the time of writing this module contains three templates
- hello-world - a minimal configuration that illustrates the absolute minimum configuration of a Centipede project
- krysalis-template - the Krysalis recomended minimum configuration for most projects.
- smoke-test - this is not really intended as a template for your own projects, it is used by the development team to test that all parts of Centipede are working correctly. It therefore contains an example of all the AntLibs available in Centipede. It can be useful as an example of how to use each cent.
Select one of the templates as a starting point for your project and copy the contents of the relevant directory into your project workspace. The directory structure for each template is almost identical, the differences are in the configuration files. We will therefore, first look at the directory structure of krysalis-template, and then we will consider the configuration files. Please note that the exact location of most of these directories can be changed by editing the configuration files, more on this later.
Directory Structure of krysalis-project Template | ||
+ legal - The licenses for the project and for any libraries included with the project. + lib - Any included library files + src + java - Java program code + documentation - Documentation source code + test - Program code and resources for test cases
Configuration Files | ||
The centipede build system is configured using a number of configuratio files. These are introduced here, and discussed in more details in later sections of this How To.
- centibuild.xml
- This is an ANT build file that is used to build the project. The reason it is not called build.xml as is normally the case for ANT build files is that we felt some projects might like to provide a vanilla ANT build script as well. These would not provide all the advantages of Centipede, but would allow the application to be built without the need to download Centipede (since many developers already have ANT).
- module.xml
- This is an extended Gump module descriptor. It contains information about the project and its dependencies.
- properties.xml
- This file is used to override the default configuration properties of Centipede antlibs.
- status.xml
- Not strictly speaking a configuration file, this contains information about the status of the project. It is used to generate release documents and todo lists amongst other things.
Documentation | ||
Centipede will generate documentation for your project during the build process. We are not going to discuss this here, it is the topic of another How To. For now it is sufficient to just insert the following three files into ./src/documentation/xdocs/, don't worry about what they are for, we'll deal with that in the documentation How To. (If you really can't wait you can have a sneak preview by pointing your browser at ./build/docs/index.html after the build has finished.)
book.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE book PUBLIC "-//APACHE//DTD Cocoon Documentation Book V1.0//EN" "../dtd/book-cocoon-v10.dtd"> <book software="Krysalis Centipede" title="Krysalis Centipede" copyright="@year@ Krysalis Project" xmlns:xlink="http://www.w3.org/1999/xlink"> <menu label="Code"> <menu-item label="Build System" href="centipede/index.html"/> </menu> </book>
index.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "../../dtd/document-v11.dtd"> <document> <header> <title>Krysalis Centipede - Demo Application for How To Documents</title> <authors> <person id="rdg" name="Ross D. Gardler" email="ross@saafe.org"/> </authors> </header> <body> <section> <title>Introduction</title> <p>This is the home page of the Demo Application for hte How To Documentation of Centipede.</p> </section> </body> </document>
tabs.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE tabs PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.0//EN" "tab-cocoon-v10.dtd"> <tabs software="MyProj" title="MyProj" copyright="Foo" xmlns:xlink="http://www.w3.org/1999/xlink"> <tab label="Home" dir=""/> </tabs>
by Ross D. Gardler