Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 160 lines (140 sloc) 6.747 kb
6657e5a @jwage Preparing migrations for distribution.
jwage authored
1 <?xml version="1.0"?>
2
3 <!--
4 Doctrine 2 build file.
5 -->
6
7 <project name="DoctrineMigrations" default="build" basedir=".">
8 <property file="build.properties" />
9
10 <!--
11 Fileset for artifacts shared across all distributed packages.
12 -->
13 <fileset id="shared-artifacts" dir=".">
14 <include name="LICENSE"/>
15 </fileset>
16
17 <!--
18 Fileset for the sources of the Doctrine Common dependency.
19 -->
20 <fileset id="common-sources" dir="./lib/vendor/doctrine-common/lib">
21 <include name="Doctrine/Common/**"/>
22 </fileset>
23
24 <!--
25 Fileset for the sources of the Doctrine Migrations.
26 -->
27 <fileset id="migrations-sources" dir="./lib">
28 <include name="Doctrine/DBAL/Migrations/**"/>
29 </fileset>
30
31 <!--
da7dc54 @beberlei Add Symfony Components Console Dependency, added Phar CLI Stub, added ph...
beberlei authored
32 Fileset for the sources of the Doctrine DBAL package.
33 -->
34 <fileset id="dbal-sources" dir="./lib/vendor/doctrine-dbal/lib">
35 <include name="Doctrine/DBAL/**"/>
36 </fileset>
37
38 <!--
6657e5a @jwage Preparing migrations for distribution.
jwage authored
39 Fileset for source of the Symfony YAML and Console components.
40 -->
41 <fileset id="symfony-sources" dir="./lib/vendor">
42 <include name="Symfony/Components/**"/>
43 </fileset>
44
45 <!--
46 Clean the directory for the next build.
47 -->
48 <target name="clean">
49 <available file="./build.properties" property="build_properties_exist" value="true"/>
50 <fail unless="build_properties_exist" message="The build.properties file is missing." />
51
52 <delete dir="${build.dir}" includeemptydirs="true" />
53 <delete dir="${dist.dir}" includeemptydirs="true" />
54 <delete dir="${report.dir}" includeemptydirs="true" />
55 </target>
56
57 <!--
58 Prepare the new build directories after cleaning
59 -->
60 <target name="prepare" depends="clean">
61 <echo msg="Creating build directory: ${build.dir}" />
62 <mkdir dir="${build.dir}" />
63 <echo msg="Creating distribution directory: ${dist.dir}" />
64 <mkdir dir="${dist.dir}" />
65 <echo msg="Creating report directory: ${report.dir}" />
66 <mkdir dir="${report.dir}" />
67 <mkdir dir="${build.dir}/logs"/>
68 <mkdir dir="${report.dir}/tests"/>
69 </target>
70
71 <!--
72 Builds Migrations package, preparing it for distribution.
73 -->
74 <target name="build-migrations" depends="test">
75 <copy todir="${build.dir}/migrations">
76 <fileset refid="shared-artifacts"/>
77 </copy>
78 <copy todir="${build.dir}/migrations">
79 <fileset refid="common-sources"/>
da7dc54 @beberlei Add Symfony Components Console Dependency, added Phar CLI Stub, added ph...
beberlei authored
80 <fileset refid="dbal-sources" />
6657e5a @jwage Preparing migrations for distribution.
jwage authored
81 <fileset refid="migrations-sources"/>
82 </copy>
83 <copy todir="${build.dir}/migrations/Doctrine">
84 <fileset refid="symfony-sources"/>
85 </copy>
86 <exec command="sed 's/${version}-DEV/${version}/' ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version.php > ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version2.php" passthru="true" />
87 <exec command="mv ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version2.php ${build.dir}/migrations/Doctrine/DBAL/Migrations/Version.php" passthru="true" />
da7dc54 @beberlei Add Symfony Components Console Dependency, added Phar CLI Stub, added ph...
beberlei authored
88
89 <pharpackage destfile="${build.dir}/doctrine-migrations.phar" basedir="${build.dir}/migrations" stub="./phar-cli-stub.php">
90 <fileset dir="${build.dir}/migrations">
91 <include name="**/**" />
92 </fileset>
93 <metadata>
94 <element name="version" value="${version}" />
95 <element name="authors">
96 <element name="Johnathan H. Wage">
97 <element name="e-mail" value="jonwage@gmail.com" />
98 </element>
99 </element>
100 </metadata>
101 </pharpackage>
102
6657e5a @jwage Preparing migrations for distribution.
jwage authored
103 </target>
104
105 <target name="build" depends="test, build-migrations"/>
106
107 <!--
108 Runs the full test suite.
109 -->
110 <target name="test" depends="prepare">
111 <if><equals arg1="${test.phpunit_generate_coverage}" arg2="1" />
112 <then>
113 <property name="test.phpunit_coverage_file" value="${build.dir}/logs/clover.xml" />
114 </then>
115 <else>
116 <property name="test.phpunit_coverage_file" value="false" />
117 </else>
118 </if>
119
1148231 @beberlei Refactoring Configuration (and tests), and build
beberlei authored
120 <exec command="phpunit --configuration ${test.phpunit_configuration_option} ${test.phpunit_coverage_option} --log-junit ${project.basedir}/${build.dir}/logs/testsuites.xml Doctrine/DBAL/Migrations/Tests/" dir="./tests" passthru="true" />
6657e5a @jwage Preparing migrations for distribution.
jwage authored
121 <phpunitreport infile="${build.dir}/logs/testsuites.xml" format="frames" todir="${report.dir}/tests" />
122
123 <tstamp/>
124 <copy file="${build.dir}/logs/testsuites.xml" tofile="${log.archive.dir}/latest/log.xml" overwrite="true"/>
125
126 <if><equals arg1="${test.pmd_reports}" arg2="1" />
127 <then>
128 <exec command="${test.pdepend_exec} --jdepend-xml=${build.dir}/logs/jdepend.xml ./lib/Doctrine" />
129 <exec command="${test.phpmd_exec} ./lib/Doctrine xml codesize --reportfile ${build.dir}/logs/phpmd.xml" />
130
131 <copy file="${build.dir}/logs/jdepend.xml" tofile="${log.archive.dir}/latest/jdepend.xml" overwrite="true"/>
132 <copy file="${build.dir}/logs/phpmd.xml" tofile="${log.archive.dir}/latest/phpmd.xml" overwrite="true"/>
133 </then>
134 </if>
135 </target>
136
137 <!--
138 Builds distributable PEAR packages.
139 -->
140 <target name="build-packages" depends="build-migrations">
c8ed5c4 @beberlei Fixed some more stuff in phing build and cli stub
beberlei authored
141 <taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
6657e5a @jwage Preparing migrations for distribution.
jwage authored
142 <d51pearpkg2 baseinstalldir="/" dir="${build.dir}/migrations">
143 <name>DoctrineMigrations</name>
144 <summary>Doctrine Database Migrations</summary>
145 <channel>pear.doctrine-project.org</channel>
146 <description>The Doctrine migrations offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is easy to use and a very powerful tool!</description>
147 <lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
148 <license>LGPL</license>
149 <version release="${version}" api="${version}" />
150 <stability release="${stability}" api="${stability}" />
151 <notes>-</notes>
152 <dependencies>
153 <php minimum_version="5.3.0" />
154 <pear minimum_version="1.6.0" recommended_version="1.6.1" />
155 </dependencies>
156 </d51pearpkg2>
157 <exec command="pear package" dir="${build.dir}/migrations" passthru="true" />
158 <exec command="mv DoctrineMigrations-${version}.tgz ../../dist" dir="${build.dir}/migrations" passthru="true" />
159 </target>
160 </project>
Something went wrong with that request. Please try again.