| 1 |
<!-- |
|---|
| 2 |
Use this file to faciliate easy per-project building using |
|---|
| 3 |
PEAR-installed Propel-generator. |
|---|
| 4 |
|
|---|
| 5 |
This Phing script is invoked via the shell script propel-gen (.bat |
|---|
| 6 |
for Windows). Normally you should not need to edit this script or |
|---|
| 7 |
be aware of it in any way. |
|---|
| 8 |
|
|---|
| 9 |
Normal use: |
|---|
| 10 |
$> propel-gen /path/to/my/project |
|---|
| 11 |
|
|---|
| 12 |
Specific target: |
|---|
| 13 |
$> propel-gen insert-sql /path/to/my/project |
|---|
| 14 |
|
|---|
| 15 |
--> |
|---|
| 16 |
<project name="propel-project-builder" default="main" basedir="."> |
|---|
| 17 |
|
|---|
| 18 |
<!-- set a default target if none provided --> |
|---|
| 19 |
<property name="target" value="main"/> |
|---|
| 20 |
|
|---|
| 21 |
<resolvepath propertyName="propel.project.dir" file="${project.dir}" dir="${application.startdir}"/> |
|---|
| 22 |
|
|---|
| 23 |
<target name="projdircheckExists"> |
|---|
| 24 |
<condition property="projDirExists"> |
|---|
| 25 |
<and> |
|---|
| 26 |
<not> |
|---|
| 27 |
<equals arg1="${propel.project.dir}" arg2="" trim="true"/> |
|---|
| 28 |
</not> |
|---|
| 29 |
<available file="${propel.project.dir}/build.properties"/> |
|---|
| 30 |
</and> |
|---|
| 31 |
</condition> |
|---|
| 32 |
</target> |
|---|
| 33 |
|
|---|
| 34 |
<target name="projdircheck" depends="projdircheckExists" unless="projDirExists"> |
|---|
| 35 |
<echo message="====================================================="/> |
|---|
| 36 |
<echo message="Project directory not specified or invalid. You must "/> |
|---|
| 37 |
<echo message="specify the path to your project directory and your "/> |
|---|
| 38 |
<echo message="project directory must contain your build.properties "/> |
|---|
| 39 |
<echo message="and schema.xml files. "/> |
|---|
| 40 |
<echo message=" "/> |
|---|
| 41 |
<echo message="Usage: "/> |
|---|
| 42 |
<echo message=" "/> |
|---|
| 43 |
<echo message="$> propel-gen /path/to/projectdir [target]"/> |
|---|
| 44 |
<echo message=" "/> |
|---|
| 45 |
<echo message="====================================================="/> |
|---|
| 46 |
<fail message="No project directory specified."/> |
|---|
| 47 |
</target> |
|---|
| 48 |
|
|---|
| 49 |
<target name="configure" depends="projdircheck"> |
|---|
| 50 |
<if> |
|---|
| 51 |
<isset property="additional.properties"/> |
|---|
| 52 |
<then> |
|---|
| 53 |
<echo>Processing additional properties file: ${additional.properties}</echo> |
|---|
| 54 |
<resolvepath propertyName="additional.properties.resolved" file="${additional.properties}" dir="${application.startdir}"/> |
|---|
| 55 |
<property file="${additional.properties.resolved}"/> |
|---|
| 56 |
</then> |
|---|
| 57 |
</if> |
|---|
| 58 |
<echo msg="Loading project-specific props from ${project.dir}/build.properties"/> |
|---|
| 59 |
<property file="${propel.project.dir}/build.properties"/> |
|---|
| 60 |
</target> |
|---|
| 61 |
|
|---|
| 62 |
<target name="main" depends="configure" |
|---|
| 63 |
description="The main target. Includes project-specific build.properties and calls the build-propel.xml script"> |
|---|
| 64 |
|
|---|
| 65 |
<!--<property file="${project.dir}/build.properties"/>--> |
|---|
| 66 |
<phing phingfile="build-propel.xml" target="${target}"/> |
|---|
| 67 |
|
|---|
| 68 |
</target> |
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
<!-- |
|---|
| 72 |
Convenience mappings to build-propel.xml main targets |
|---|
| 73 |
|
|---|
| 74 |
This makes it possible to use this buildfile w/o needing to specify |
|---|
| 75 |
target as a property, e.g.: |
|---|
| 76 |
|
|---|
| 77 |
$> phing -Dproject=bookstore insert-sql |
|---|
| 78 |
|
|---|
| 79 |
The main reason for this is just consistency w/ old build-propel.xml file |
|---|
| 80 |
(primarily for documentation & user confusion avoidance reasons). There are relatively |
|---|
| 81 |
few & infrequently changing main targets of build-propel.xml, so it's a non- |
|---|
| 82 |
issue as far as maintenance is concerned. |
|---|
| 83 |
--> |
|---|
| 84 |
|
|---|
| 85 |
<target name="convert-conf" depends="configure"> |
|---|
| 86 |
<phing phingfile="build-propel.xml" target="convert-conf"/> |
|---|
| 87 |
</target> |
|---|
| 88 |
|
|---|
| 89 |
<target name="create-db" depends="configure"> |
|---|
| 90 |
<phing phingfile="build-propel.xml" target="create-db"/> |
|---|
| 91 |
</target> |
|---|
| 92 |
|
|---|
| 93 |
<target name="creole" depends="configure"> |
|---|
| 94 |
<phing phingfile="build-propel.xml" target="creole"/> |
|---|
| 95 |
</target> |
|---|
| 96 |
|
|---|
| 97 |
<target name="reverse" depends="configure"> |
|---|
| 98 |
<phing phingfile="build-propel.xml" target="reverse"/> |
|---|
| 99 |
</target> |
|---|
| 100 |
|
|---|
| 101 |
<target name="datadtd" depends="configure"> |
|---|
| 102 |
<phing phingfile="build-propel.xml" target="datadtd"/> |
|---|
| 103 |
</target> |
|---|
| 104 |
|
|---|
| 105 |
<target name="datadump" depends="configure"> |
|---|
| 106 |
<phing phingfile="build-propel.xml" target="datadump"/> |
|---|
| 107 |
</target> |
|---|
| 108 |
|
|---|
| 109 |
<target name="datasql" depends="configure"> |
|---|
| 110 |
<phing phingfile="build-propel.xml" target="datasql"/> |
|---|
| 111 |
</target> |
|---|
| 112 |
|
|---|
| 113 |
<target name="insert-sql" depends="configure"> |
|---|
| 114 |
<phing phingfile="build-propel.xml" target="insert-sql"/> |
|---|
| 115 |
</target> |
|---|
| 116 |
|
|---|
| 117 |
<target name="om" depends="configure"> |
|---|
| 118 |
<phing phingfile="build-propel.xml" target="om"/> |
|---|
| 119 |
</target> |
|---|
| 120 |
|
|---|
| 121 |
<target name="sql" depends="configure"> |
|---|
| 122 |
<phing phingfile="build-propel.xml" target="sql"/> |
|---|
| 123 |
</target> |
|---|
| 124 |
|
|---|
| 125 |
</project> |
|---|