Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tag: 1.6.0
Fetching contributors…

Cannot retrieve contributors at this time

239 lines (189 sloc) 8.94 kB
Use this file to faciliate easy per-project building.
Simply create a file in your project directory,
for example ./projects/bookstore/, that contains
any needed (i.e. to override) values for that project.
Call this build script and specify the name of the project and
(optionally) the name of the target you wish to execute (default is
'main' target) of build-propel.xml.
Normal use:
$> phing -Dproject=bookstore
Specific target:
$> phing -Dproject=bookstore -Dtarget=insert-sql
<project name="propel-project-builder" default="main">
<!-- in case ${project.dir} was specified on command line, we set the project.dir
property here. If it wasn't set, then this will be bogus, but it will
be overridden by the "set-project-dir" target. -->
<resolvepath propertyName="propel.project.dir" file="${project.dir}" dir="${application.startdir}"/>
<!-- set a default target if none provided -->
<property name="target" value="main"/>
<!-- Set a default name for the file.
This allows for overriding the name of the file; however,
Propel still expects to find the file in the ${propel.project.dir}.
<property name="" value=""/>
<target name="check-buildprops-exists">
<available file="${propel.project.dir}/${}" property="projBuildPopertiesExists"/>
<target name="check-buildprops" unless="projBuildPopertiesExists" depends="check-buildprops-exists">
<echo message="====================================================="/>
<echo message="Could not open ${} file:"/>
<echo message=" ${propel.project.dir}${}"/>
<echo message=" "/>
<echo message="Make sure that '${propel.project.dir}' is a valid path"/>
<echo message="and that it contains a ${} file."/>
<echo message="====================================================="/>
<fail message="Missing configuration file (see description above)."/>
<target name="check-project-or-dir-set">
<condition property="projectOrDirSet">
<isset property="project"/>
<isset property="project.dir"/>
<target name="check-buildprops-for-propel-gen" if="using.propel-gen" unless="projBuildPopertiesExists" depends="check-buildprops-exists">
<echo message="=========================================================="/>
<echo message=" Welcome to Propel!"/>
<echo message=" "/>
<echo message="The propel-gen script requires a ${} file"/>
<echo message="to run. Either you didn't create one already, or this file"/>
<echo message="is not where the propel-gen script is looking for it."/>
<echo message=" "/>
<echo message="Expected ${} file location is:"/>
<echo message=" ${propel.project.dir}${}"/>
<echo message=" "/>
<echo message="The propel-gen script expects the name of a task to execute:"/>
<echo message=" "/>
<echo message="$&gt; propel-gen [taskname]"/>
<echo message=" "/>
<echo message="If you call the script from another directory than the one where"/>
<echo message="where the ${} file is, set the path to this"/>
<echo message="file as first argument of the script:"/>
<echo message=" "/>
<echo message="$&gt; propel-gen /path/to/projectdir [taskname]"/>
<echo message=" "/>
<echo message="Available tasknames are:"/>
<echo message=" om"/>
<echo message=" convert-conf"/>
<echo message=" sql"/>
<echo message=" insert-sql"/>
<echo message=" diff"/>
<echo message=" status"/>
<echo message=" migrate"/>
<echo message=" up"/>
<echo message=" down"/>
<echo message=" reverse"/>
<echo message=" ... and a few others."/>
<echo message="But you should start by creating a schema."/>
<echo message="=========================================================="/>
<fail message="No project directory specified."/>
<target name="check-project-set" unless="projectOrDirSet" depends="check-project-or-dir-set">
<echo message="====================================================="/>
<echo message="Project not specified. You must enter a project name. "/>
<echo message="In the future you can enter it on the command line: "/>
<echo message=" "/>
<echo message="-Dproject=bookstore"/>
<echo message=" "/>
<echo message="This will attempt to find your project directory in"/>
<echo message="the default directory (./projects/bookstore)."/>
<echo message=" "/>
<echo message="You can also avoid this message and specicfy a custom "/>
<echo message="directory, using the project.dir property:"/>
<echo message=" "/>
<echo message="-Dproject.dir=/path/to/bookstore"/>
<echo message="====================================================="/>
<input propertyname="project" promptChar=":">Project name</input>
<property name="propel.project" value="${project}" override="true"/>
<target name="set-project-dir" unless="project.dir" depends="check-project-set">
<echo>No project.dir was specified, using default path: ./projects/${project}</echo>
<property name="propel.project.dir" value="./projects/${project}" override="true"/>
<target name="configure" depends="set-project-dir,check-buildprops-for-propel-gen,check-buildprops">
<isset property=""/>
<echo>Processing additional properties file: ${}</echo>
<resolvepath propertyName="" file="${}" dir="${application.startdir}"/>
<property file="${}"/>
<echo msg="Loading project-specific props from ${propel.project.dir}/${}"/>
<property file="${propel.project.dir}/${}"/>
<target name="main" depends="configure" description="The main target. Includes project-specific and calls the build-propel.xml script">
<phing phingfile="./build-propel.xml" target="${target}"/>
Convenience mappings to build-propel.xml main targets
This makes it possible to use this buildfile w/o needing to specify
target as a property, e.g.:
$> phing -Dproject=bookstore insert-sql
The main reason for this is just consistency w/ old build-propel.xml file
(primarily for documentation & user confusion avoidance reasons). There are relatively
few & infrequently changing main targets of build-propel.xml, so it's a non-
issue as far as maintenance is concerned.
<target name="convert-conf" depends="configure">
<phing phingfile="build-propel.xml" target="convert-conf"/>
<target name="create-db" depends="configure">
<phing phingfile="build-propel.xml" target="create-db"/>
<target name="reverse" depends="configure">
<phing phingfile="build-propel.xml" target="reverse"/>
<target name="datadump" depends="configure">
<phing phingfile="build-propel.xml" target="datadump"/>
<target name="datasql" depends="configure">
<phing phingfile="build-propel.xml" target="datasql"/>
<target name="insert-sql" depends="configure">
<phing phingfile="build-propel.xml" target="insert-sql"/>
<target name="om" depends="configure">
<phing phingfile="build-propel.xml" target="om"/>
<target name="new-om" depends="configure">
<phing phingfile="build-propel.xml" target="new-om"/>
<target name="sql" depends="configure">
<phing phingfile="build-propel.xml" target="sql"/>
<target name="sql-diff" depends="configure">
<phing phingfile="build-propel.xml" target="sql-diff"/>
<target name="diff" depends="sql-diff" />
<target name="migration-status" depends="configure">
<phing phingfile="build-propel.xml" target="migration-status"/>
<target name="status" depends="migration-status" />
<target name="migration-up" depends="configure">
<phing phingfile="build-propel.xml" target="migration-up"/>
<target name="migrate-up" depends="migration-up" />
<target name="up" depends="migration-up" />
<target name="migration-down" depends="configure">
<phing phingfile="build-propel.xml" target="migration-down"/>
<target name="migrate-down" depends="migration-down" />
<target name="down" depends="migration-down" />
<target name="migration" depends="configure">
<phing phingfile="build-propel.xml" target="migration"/>
<target name="migrate" depends="migration" />
<target name="old-sql" depends="configure">
<phing phingfile="build-propel.xml" target="old-sql"/>
<target name="dbd2propel" depends="configure">
<phing phingfile="build-propel.xml" target="dbd2propel"/>
<target name="graphviz" depends="configure">
<phing phingfile="build-propel.xml" target="graphviz"/>
Jump to Line
Something went wrong with that request. Please try again.