link
Avalon
Avalon Central
Home PlanetProductsCentral
Creating a project index.

A magic buildfile gets information about the project it is building from an index file. The following example shows a minimal index file containing two projects. The example is available under your merlin installation main repository (sub-directory avalon/tools/demos) or alternatively just download demo.zip.

index.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<system>

  <project basedir="gizmo">
    <info>
      <group>demo</group>
      <name>gizmo</name>
    </info>
  </project>

  <project basedir="widget">
    <info>
      <group>demo</group>
      <name>widget</name>
    </info>
    <dependencies>
      <include key="gizmo"/>
    </dependencies>
  </project>

</system>
 

The index file show above contains two product defintions - one for gizmo and one for widget. The basedir attributes tells magic where to find these projects relative to the location of the index.

The following is the build file using for the gizmo project.

<?xml version="1.0" encoding="UTF-8" ?>

<project name="gizmo" default="install" basedir="." 
    xmlns:x="antlib:org.apache.avalon.tools">

  <!-- Search for an index.xml file from current directory and upwards
       in the directory structures.  -->
  <x:home />
  <import file="${magic.templates}/standard.xml"/>

</project>

Some important things to note in the above build file:

You should have a general idea of the structure of an index based on the information described above. While there are several notions we have not discussed yet (external resources, plugins defintions, index importing, etc.) we will move on to actually building widget and gizmo - described under the next subject - My First Spell.