Chapter 5 Project components

This goal of this chapter is to make you familiar with the basic components of a buildfile. After reading this chapter, you should be able to read and understand the basic structure of any buildfile even if you don't know exactly what the individual pieces do.

For supplemental reference information, you should see Appendix B, Core tasks, Appendix D, Core Types and Appendix H, Project Components.

5.1 Projects

In the structure of a Phing buildfile, there must be exactly one Project defined; the <project> tag is the root element of the buildfile, meaning that everything else in the buildfile is contained within the <project > element.

<?xml version="1.0"?>

<project name="test" description="Simple test build file" default="main" >
  <!-- Everything else here -->
<project>

The listing above shows a sample <project> tag that has all attributes available for Projects. The name and description attributes are fairly self-explanatory; the default attribute specifies the default Target to execute if no target is specified (Section H.2, “Targets and Extension-Points” are described below). For a complete reference, see Appendix H, Project Components.