| 1 |
<!-- |
|---|
| 2 |
Use this file to faciliate easy per-project building. |
|---|
| 3 |
|
|---|
| 4 |
Simply create a build.properties file in your project directory, |
|---|
| 5 |
for example ./projects/bookstore/build.properties, that contains |
|---|
| 6 |
any needed (i.e. to override) values for that project. |
|---|
| 7 |
|
|---|
| 8 |
Call this build script and specify the name of the project and |
|---|
| 9 |
(optionally) the name of the target you wish to execute (default is |
|---|
| 10 |
'main' target) of build-propel.xml. |
|---|
| 11 |
|
|---|
| 12 |
Normal use: |
|---|
| 13 |
$> phing -Dproject=bookstore |
|---|
| 14 |
|
|---|
| 15 |
Specific target: |
|---|
| 16 |
$> phing -Dproject=bookstore -Dtarget=insert-sql |
|---|
| 17 |
|
|---|
| 18 |
--> |
|---|
| 19 |
<project name="propel-project-builder" default="main" basedir="."> |
|---|
| 20 |
|
|---|
| 21 |
<!-- in case ${project} was specified on command line, we set the project.dir |
|---|
| 22 |
property here. If it wasn't set, then this will be bogus, but it will |
|---|
| 23 |
be overridden by the "projectcheck" target. --> |
|---|
| 24 |
<property name="project.dir" value="./projects/${project}"/> |
|---|
| 25 |
|
|---|
| 26 |
<!-- set a default target if none provided --> |
|---|
| 27 |
<property name="target" value="main"/> |
|---|
| 28 |
|
|---|
| 29 |
<target name="buildpropescheck"> |
|---|
| 30 |
<available file="${project.dir}/build.properties" property="projBuildPopertiesExists"/> |
|---|
| 31 |
</target> |
|---|
| 32 |
|
|---|
| 33 |
<target name="projectcheck" unless="project"> |
|---|
| 34 |
<echo message="====================================================="/> |
|---|
| 35 |
<echo message="Project not specified. You must enter a project name. "/> |
|---|
| 36 |
<echo message="In the future you can enter it on the command line: "/> |
|---|
| 37 |
<echo message=" "/> |
|---|
| 38 |
<echo message="-Dproject=bookstore"/> |
|---|
| 39 |
<echo message="====================================================="/> |
|---|
| 40 |
<input propertyname="project" promptChar=":">Project name</input> |
|---|
| 41 |
<property name="project.dir" value="./projects/${project}" override="true"/> |
|---|
| 42 |
</target> |
|---|
| 43 |
|
|---|
| 44 |
<target name="configure" depends="projectcheck"> |
|---|
| 45 |
<echo msg="Loading project-specific props from ${project.dir}/build.properties"/> |
|---|
| 46 |
<property file="${project.dir}/build.properties"/> |
|---|
| 47 |
</target> |
|---|
| 48 |
|
|---|
| 49 |
<target name="main" depends="configure" |
|---|
| 50 |
description="The main target. Includes project-specific build.properties and calls the build-propel.xml script"> |
|---|
| 51 |
|
|---|
| 52 |
<!--<property file="${project.dir}/build.properties"/>--> |
|---|
| 53 |
<phing phingfile="./build-propel.xml" target="${target}"/> |
|---|
| 54 |
|
|---|
| 55 |
</target> |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
<!-- |
|---|
| 59 |
Convenience mappings to build-propel.xml main targets |
|---|
| 60 |
|
|---|
| 61 |
This makes it possible to use this buildfile w/o needing to specify |
|---|
| 62 |
target as a property, e.g.: |
|---|
| 63 |
|
|---|
| 64 |
$> phing -Dproject=bookstore insert-sql |
|---|
| 65 |
|
|---|
| 66 |
The main reason for this is just consistency w/ old build-propel.xml file |
|---|
| 67 |
(primarily for documentation & user confusion avoidance reasons). There are relatively |
|---|
| 68 |
few & infrequently changing main targets of build-propel.xml, so it's a non- |
|---|
| 69 |
issue as far as maintenance is concerned. |
|---|
| 70 |
--> |
|---|
| 71 |
|
|---|
| 72 |
<target name="convert-props" depends="configure"> |
|---|
| 73 |
<phing phingfile="build-propel.xml" target="convert-props"/> |
|---|
| 74 |
</target> |
|---|
| 75 |
|
|---|
| 76 |
<target name="create-db" depends="configure"> |
|---|
| 77 |
<phing phingfile="build-propel.xml" target="create-db"/> |
|---|
| 78 |
</target> |
|---|
| 79 |
|
|---|
| 80 |
<target name="creole" depends="configure"> |
|---|
| 81 |
<phing phingfile="build-propel.xml" target="creole"/> |
|---|
| 82 |
</target> |
|---|
| 83 |
|
|---|
| 84 |
<target name="datadtd" depends="configure"> |
|---|
| 85 |
<phing phingfile="build-propel.xml" target="datadtd"/> |
|---|
| 86 |
</target> |
|---|
| 87 |
|
|---|
| 88 |
<target name="datadump" depends="configure"> |
|---|
| 89 |
<phing phingfile="build-propel.xml" target="datadump"/> |
|---|
| 90 |
</target> |
|---|
| 91 |
|
|---|
| 92 |
<target name="datasql" depends="configure"> |
|---|
| 93 |
<phing phingfile="build-propel.xml" target="datasql"/> |
|---|
| 94 |
</target> |
|---|
| 95 |
|
|---|
| 96 |
<target name="insert-sql" depends="configure"> |
|---|
| 97 |
<phing phingfile="build-propel.xml" target="insert-sql"/> |
|---|
| 98 |
</target> |
|---|
| 99 |
|
|---|
| 100 |
<target name="om" depends="configure"> |
|---|
| 101 |
<phing phingfile="build-propel.xml" target="om"/> |
|---|
| 102 |
</target> |
|---|
| 103 |
|
|---|
| 104 |
<target name="sql" depends="configure"> |
|---|
| 105 |
<phing phingfile="build-propel.xml" target="sql"/> |
|---|
| 106 |
</target> |
|---|
| 107 |
|
|---|
| 108 |
<target name="graphviz" depends="configure"> |
|---|
| 109 |
<phing phingfile="build-propel.xml" target="graphviz"/> |
|---|
| 110 |
</target> |
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
</project> |
|---|