The Depot build system centralizes information about projects in an index file. This tutorial demonstrates the declaration of a single project and serves as a starting point for the introduction of properties and filters.
The following index file declares a single project named 'demo'. The basedir of the project is the directory containing the project build content and is the path that the Depot tool uses to locate the project's build.xml file. Basedir values are resolved relative to the basedir of the enclosing entity - in this case the <index> is the enclosing entity so the basedir is resolved relative to the directory containing the index file.
<?xml version="1.0" encoding="ISO-8859-1"?> <index xmlns="dpml:library"> <project name="demo" basedir="."/> </index>
The following Ant build file simply logs a message to confirm that it is building. It contains a couple of empty targets (clean and install) which are added simply for consistency (but will be used in subsequent tutorials).
<project name="demo" default="install"> <target name="clean"> <!-- nothing to do --> </target> <target name="build"> <echo message="Executing the simple project build."/> </target> <target name="install" depends="build"/> </project>
Assuming that you have the build file and the index file in a directory and Depot is installed - you should be able to start the build proces using Depot's build command as shown below:
$ cd tutorials\tooling\simple $ build ------------------------------------------------------------------------- demo#SNAPSHOT ------------------------------------------------------------------------- build: [echo] Executing the simple project build. BUILD SUCCESSFUL Total time: 0 seconds $
When we invoked the build command as shown above - the build tool located the index.xml file (by searching from the current directory up the directory tree until the file was found) and located the demo project by matching the current directory with directory resolved from the project basedir attribute. Once the project defintion is located Depot constructs an internal defintion containing information about the project name, group, version, properties, filters, dependency information, and information about resources that will be produced by the build process.
The next tutorial introduces the declaration of project and module level properties.