ObjectMagic.org

Back to home

Project Structure

Here follows a brief introduction to the projects structure under the ObjectMagic.org umbrella.
    <project root>
		prd
Root of source code
			src
Root of package configuration files
			deploy
				config
					bundle
						resources
					custom
						resources
Documents, LICENSE, README
			doc
jars used during the build process (in build) and to redistribute (in dist)
			lib
				build
				dist
		
These directories are created during the build process
		build
			classes
			deploy
				<recopy of prd/deploy with ant substitution of @param@>
			doc
			lib
		dist
			doc
			lib
Contains packaged binary and source distribution
		release
		
  
The structure sketched above is a typical layout, even if there may be variants depending on specific project needs. As an example, JDO projects place their mapping files under prd/deploy/config/jdo/<vendor>.
Assuming a package named sample with release x.y.z, the build process produces in dist/lib at least 3 jars:
sample.jar, containing the classes
sample-bundle-x.y.z.jar, containing the files in build/deploy/config/bundle/resources with no prefix in jar
sample-custom-x.y.z.jar, containing the files in build/deploy/config/custom/resources with no prefix in jar

A JDO projects produces also:
sample-jdo-x.y.z.jar, containing the files in prd/deploy/config/jdo/<vendor> with no prefix in jar

Under dist/doc there is a recopy of prd/doc and the API javadoc under dist/doc/api

Dependencies Management

build.xml Ant files contain the definition of two tasks the provide the support for dependencies management.
Dependencies are controlled by two files: dependencies.properties and pdr.properties
The first file is a Java properties file where the key is a package name, such as log4j, and the value is the release which this package depends upon, e.g. 1.2.8. The second one describes where the jars that compose the dependencies are located.
Each line of the file is structured as follows:
[type=]location
if type assumes the value local then the location is a local directory, or a network share, that represents the root of packages releases.
if type assumes the value maven then the location is the url of a maven repository.
Lines starting with # character are ignored.

Local repositories are structured as follows:

    <repository root>
		<package name>
			<package release>

An example follows
    <repository root>
		log4j
			1.2.8
  
All the dependency jars in <repository root>/<package name>/<package release> are copied in build/lib

Maven type repositories, instead, execute a download from <url prefix>/<package name>/jars/<package name>-<package release>.jar
Sometimes certains packages jars share the same directory in maven. As an example, the jars commons-logging-x.y.z.jar and commons-logging-api-x.y.z.jar are placed in the same commons-logging/jars mave directory.
In this case, in the dependencies.properties is possible to specify this common directory as:

commons-logging=1.0.3
commons-logging/commons-logging-api=1.0.3
  

Ant Targets

The typical Ant targets are:
dist, that compiles the source and creates the jars in dist/lib
doc, that copies prd/doc in build/doc and generates javadoc in build/doc/api
full-dist, that depends on dist and doc and adds the content of prd/lib/dist in dist/lib and of build/doc in dist/doc


For any comment on this site, drop a mail to webmaster

For any comment, question, suggestion on the various packages contact voodoo@objectmagic.org (Yes, even for bug report)