| 1 |
<?xml version="1.0"?> |
|---|
| 2 |
|
|---|
| 3 |
<!-- |
|---|
| 4 |
This build file creates a minimal package of propel-generator files, |
|---|
| 5 |
builds a package.xml for installation using PEAR and creates the necessary TGZ file. |
|---|
| 6 |
|
|---|
| 7 |
It's pretty easy to build the PEAR package: |
|---|
| 8 |
|
|---|
| 9 |
$> cd /path/to/propel-generator |
|---|
| 10 |
$> phing -Dversion=1.0.0RC1 -f pear\build-pear-package.xml |
|---|
| 11 |
|
|---|
| 12 |
--> |
|---|
| 13 |
|
|---|
| 14 |
<project name="propel_generator" basedir="." default="main"> |
|---|
| 15 |
|
|---|
| 16 |
<property name="propelgen.home" value=".."/> |
|---|
| 17 |
<property name="build.base.dir" value="build"/> |
|---|
| 18 |
<property name="pkgname" value="${phing.project.name}-${version}"/> |
|---|
| 19 |
<property name="build.src.dir" value="${build.base.dir}/${pkgname}"/> |
|---|
| 20 |
|
|---|
| 21 |
<!-- some default properties --> |
|---|
| 22 |
<property name="notes"><![CDATA[This is a beta release for the 1.3 branch of the Propel Generator. |
|---|
| 23 |
See: http://propel.phpdb.org/trac/query?status=closed&milestone=1.3&resolution=fixed&order=priority for CHANGELOG. |
|---|
| 24 |
]]></property> |
|---|
| 25 |
<property name="state" value="beta"/> |
|---|
| 26 |
|
|---|
| 27 |
<taskdef |
|---|
| 28 |
name="pear-package" |
|---|
| 29 |
classname="BuildPropelGenPEARPackageTask" classpath="."/> |
|---|
| 30 |
|
|---|
| 31 |
<fileset dir="${propelgen.home}/classes/propel" id="classes"> |
|---|
| 32 |
<include name="**"/> |
|---|
| 33 |
</fileset> |
|---|
| 34 |
|
|---|
| 35 |
<fileset dir="${propelgen.home}" id="data"> |
|---|
| 36 |
<!--<include name="build.xml"/>--> |
|---|
| 37 |
<include name="build-propel.xml"/> |
|---|
| 38 |
<include name="projects/bookstore/*"/> |
|---|
| 39 |
<include name="projects/treetest/*"/> |
|---|
| 40 |
<include name="pear/pear-build.xml"/> |
|---|
| 41 |
<include name="pear/pear-propel*"/> |
|---|
| 42 |
<include name="pear/build.properties"/> |
|---|
| 43 |
<include name="default.properties"/> |
|---|
| 44 |
<include name="templates/**"/> |
|---|
| 45 |
<include name="resources/**"/> |
|---|
| 46 |
</fileset> |
|---|
| 47 |
|
|---|
| 48 |
<!-- |
|---|
| 49 |
============================================== |
|---|
| 50 |
Main entry point |
|---|
| 51 |
============================================== |
|---|
| 52 |
--> |
|---|
| 53 |
<target name="main" if="version" depends="versioncheck"> |
|---|
| 54 |
<phingcall target="build"/> |
|---|
| 55 |
<phingcall target="pear-package"/> |
|---|
| 56 |
<phingcall target="tar"/> |
|---|
| 57 |
</target> |
|---|
| 58 |
|
|---|
| 59 |
<!-- |
|---|
| 60 |
=================================================================== |
|---|
| 61 |
Target: checks if language was given, otherwise fail |
|---|
| 62 |
=================================================================== |
|---|
| 63 |
--> |
|---|
| 64 |
<target name="versioncheck" unless="version"> |
|---|
| 65 |
<echo message="====================================================="/> |
|---|
| 66 |
<echo message="Version not specified. You must enter a version. In"/> |
|---|
| 67 |
<echo message="the future you can add this to build.properties or"/> |
|---|
| 68 |
<echo message="enter it on the command line: "/> |
|---|
| 69 |
<echo message=" "/> |
|---|
| 70 |
<echo message="-Dversion=1.0.0"/> |
|---|
| 71 |
<echo message="====================================================="/> |
|---|
| 72 |
<input propertyname="version" promptChar=":">Propel version for package</input> |
|---|
| 73 |
|
|---|
| 74 |
<property name="pkgname" value="${phing.project.name}-${version}" override="true"/> |
|---|
| 75 |
<property name="build.src.dir" value="${build.base.dir}/${pkgname}" override="true"/> |
|---|
| 76 |
|
|---|
| 77 |
</target> |
|---|
| 78 |
|
|---|
| 79 |
<!-- |
|---|
| 80 |
============================================== |
|---|
| 81 |
Copy the desired files into the build/ dir |
|---|
| 82 |
making sure to put them in the directory |
|---|
| 83 |
structure that will be needed for PEAR install |
|---|
| 84 |
============================================== |
|---|
| 85 |
--> |
|---|
| 86 |
<target name="build"> |
|---|
| 87 |
<echo>-----------------------------</echo> |
|---|
| 88 |
<echo>| Creating directory layout |</echo> |
|---|
| 89 |
<echo>-----------------------------</echo> |
|---|
| 90 |
|
|---|
| 91 |
<delete dir="${build.base.dir}"/> |
|---|
| 92 |
<mkdir dir="${build.base.dir}"/> |
|---|
| 93 |
|
|---|
| 94 |
<copy todir="${build.src.dir}"> |
|---|
| 95 |
<fileset refid="classes"/> |
|---|
| 96 |
<fileset refid="data"/> |
|---|
| 97 |
</copy> |
|---|
| 98 |
|
|---|
| 99 |
<!-- some files need to be manually moved here to save headache when |
|---|
| 100 |
doing the pear package.xml creation --> |
|---|
| 101 |
<move file="${build.src.dir}/pear/build.properties" todir="${build.src.dir}"/> |
|---|
| 102 |
<move file="${build.src.dir}/pear/pear-build.xml" todir="${build.src.dir}"/> |
|---|
| 103 |
|
|---|
| 104 |
<chmod file="${build.src.dir}/pear/pear-propel-gen" mode="755"/> |
|---|
| 105 |
|
|---|
| 106 |
</target> |
|---|
| 107 |
|
|---|
| 108 |
<!-- |
|---|
| 109 |
============================================== |
|---|
| 110 |
Create a PEAR package.xml which will guide the |
|---|
| 111 |
installation. |
|---|
| 112 |
============================================== |
|---|
| 113 |
--> |
|---|
| 114 |
<target name="pear-package"> |
|---|
| 115 |
|
|---|
| 116 |
<echo>-----------------------------</echo> |
|---|
| 117 |
<echo>| Creating PEAR package.xml |</echo> |
|---|
| 118 |
<echo>-----------------------------</echo> |
|---|
| 119 |
<echo></echo> |
|---|
| 120 |
|
|---|
| 121 |
<pear-package dir="${build.src.dir}" destFile="${build.base.dir}/package.xml" version="${version}" state="${state}" notes="${notes}"> |
|---|
| 122 |
|
|---|
| 123 |
<fileset dir="${build.src.dir}"> |
|---|
| 124 |
<include name="**"/> |
|---|
| 125 |
</fileset> |
|---|
| 126 |
|
|---|
| 127 |
</pear-package> |
|---|
| 128 |
|
|---|
| 129 |
</target> |
|---|
| 130 |
|
|---|
| 131 |
<!-- |
|---|
| 132 |
============================================== |
|---|
| 133 |
Create a tar.gz of the files, which will be |
|---|
| 134 |
installed by pear package manager. |
|---|
| 135 |
============================================== |
|---|
| 136 |
--> |
|---|
| 137 |
<target name="tar"> |
|---|
| 138 |
<echo>-----------------------------</echo> |
|---|
| 139 |
<echo>| Creating tar.gz package |</echo> |
|---|
| 140 |
<echo>-----------------------------</echo> |
|---|
| 141 |
<property name="tarfile" value="${build.base.dir}/${pkgname}.tgz"/> |
|---|
| 142 |
<delete file="${tarfile}"/> |
|---|
| 143 |
<tar destFile="${tarfile}" basedir="${build.base.dir}" /> |
|---|
| 144 |
</target> |
|---|
| 145 |
|
|---|
| 146 |
</project> |
|---|