This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
/
build.xml
239 lines (213 loc) · 12.3 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?xml version="1.0"?>
<!--
Doctrine CouchDB build file.
-->
<project name="Doctrine CouchDB" default="build" basedir=".">
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
<property file="build.properties" />
<!--
Fileset for artifacts shared across all distributed packages.
-->
<fileset id="shared-artifacts" dir=".">
<include name="LICENSE"/>
</fileset>
<!--
Fileset for command line scripts
-->
<fileset id="bin-scripts" dir="./bin">
<include name="doctrine-couchdb.php"/>
</fileset>
<!--
Fileset for the sources of the Doctrine Common dependency.
-->
<fileset id="common-sources" dir="./lib/vendor/doctrine-common/lib">
<include name="Doctrine/Common/**"/>
</fileset>
<!--
Fileset for the sources of the Doctrine CouchDB Client
-->
<fileset id="couchdb-sources" dir="./lib">
<include name="Doctrine/CouchDB/**"/>
</fileset>
<!--
Fileset for the sources of the Doctrine CouchDB ODM
-->
<fileset id="odm-sources" dir="./lib">
<include name="Doctrine/ODM/CouchDB/**"/>
</fileset>
<!--
Fileset for source of the Symfony YAML and Console components.
-->
<fileset id="symfony-sources" dir="./lib/vendor">
<include name="Symfony/Component/**"/>
</fileset>
<!--
Clean the directory for the next build.
-->
<target name="clean">
<available file="./build.properties" property="build_properties_exist" value="true"/>
<fail unless="build_properties_exist" message="The build.properties file is missing." />
<delete dir="${build.dir}" includeemptydirs="true" />
<delete dir="${dist.dir}" includeemptydirs="true" />
<delete dir="${report.dir}" includeemptydirs="true" />
</target>
<!--
Prepare the new build directories after cleaning
-->
<target name="prepare" depends="clean">
<echo msg="Creating build directory: ${build.dir}" />
<mkdir dir="${build.dir}" />
<echo msg="Creating distribution directory: ${dist.dir}" />
<mkdir dir="${dist.dir}" />
<echo msg="Creating report directory: ${report.dir}" />
<mkdir dir="${report.dir}" />
<mkdir dir="${build.dir}/logs"/>
<mkdir dir="${report.dir}/tests"/>
</target>
<!--
Builds CouchDB package, preparing it for distribution.
-->
<target name="build-couchdb" depends="prepare">
<exec command="grep '${version}' ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" checkreturn="true"/>
<copy todir="${build.dir}/doctrine-couchdb">
<fileset refid="shared-artifacts"/>
</copy>
<copy todir="${build.dir}/doctrine-couchdb">
<fileset refid="common-sources"/>
<fileset refid="couchdb-sources"/>
</copy>
<exec command="sed 's/${version}-DEV/${version}/' ${build.dir}/doctrine-couchdb/Doctrine/CouchDB/Version.php > ${build.dir}/doctrine-couchdb/Doctrine/CouchDB/Version2.php" passthru="true" />
<exec command="mv ${build.dir}/doctrine-couchdb/Doctrine/CouchDB/Version2.php ${build.dir}/doctrine-couchdb/Doctrine/CouchDB/Version.php" passthru="true" />
</target>
<target name="build-odm" depends="prepare">
<exec command="grep '${version}' ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" checkreturn="true"/>
<copy todir="${build.dir}/doctrine-odm">
<fileset refid="shared-artifacts"/>
</copy>
<copy todir="${build.dir}/doctrine-odm">
<fileset refid="common-sources"/>
<fileset refid="couchdb-sources"/>
<fileset refid="odm-sources"/>
</copy>
<copy todir="${build.dir}/doctrine-odm/Doctrine">
<fileset refid="symfony-sources"/>
</copy>
<copy todir="${build.dir}/doctrine-odm/bin">
<fileset refid="bin-scripts"/>
</copy>
<exec command="sed 's/${version}-DEV/${version}/' ${build.dir}/doctrine-odm/Doctrine/ODM/CouchDB/Version.php > ${build.dir}/doctrine-odm/Doctrine/ODM/CouchDB/Version2.php" passthru="true" />
<exec command="mv ${build.dir}/doctrine-odm/Doctrine/ODM/CouchDB/Version2.php ${build.dir}/doctrine-odm/Doctrine/ODM/CouchDB/Version.php" passthru="true" />
</target>
<target name="build" depends="build-couchdb, build-odm"/>
<!--
Builds distributable PEAR packages.
-->
<target name="build-packages" depends="build">
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/doctrine-couchdb">
<name>CouchDB</name>
<summary>Doctrine CouchDB Abstraction</summary>
<channel>pear.doctrine-project.org</channel>
<description>The Doctrine CouchDB package contains a client for CouchDB, HTTP Client and View Abstraction.</description>
<lead user="beberlei" name="Benjamin Eberlei" email="[email protected]" />
<lead user="lsmith" name="Lukas Smith" email="[email protected]" />
<license>LGPL</license>
<version release="${version}" api="${version}" />
<stability release="${stability}" api="${stability}" />
<notes>-</notes>
<dependencies>
<php minimum_version="5.3.2" />
<pear minimum_version="1.6.0" recommended_version="1.6.1" />
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="${dependencies.common}" />
<package name="DoctrineSymfonyConsole" channel="pear.doctrine-project.org" minimum_version="2.0.0" />
<package name="DoctrineSymfonyYaml" channel="pear.doctrine-project.org" minimum_version="2.0.0" />
</dependencies>
<dirroles key="bin">script</dirroles>
<ignore>Doctrine/Common/</ignore>
<ignore>Symfony/Component/Yaml/</ignore>
<ignore>Symfony/Component/Console/</ignore>
</d51pearpkg2>
<exec command="pear package" dir="${build.dir}/doctrine-couchdb" passthru="true" />
<exec command="mv CouchDB-${version}.tgz ../../dist" dir="${build.dir}/doctrine-couchdb" passthru="true" />
<tar destfile="dist/DoctrineCouchDB-${version}-full.tar.gz" compression="gzip" basedir="${build.dir}">
<fileset dir="${build.dir}">
<include name="**/**" />
<exclude name="logs/" />
<exclude name="doctrine-couchdb/package.xml" />
</fileset>
</tar>
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/doctrine-odm">
<name>CouchDBODM</name>
<summary>Doctrine CouchDB Object Document Mapper</summary>
<channel>pear.doctrine-project.org</channel>
<description>The Doctrine CouchDB ODM package contains document mapper.</description>
<lead user="beberlei" name="Benjamin Eberlei" email="[email protected]" />
<lead user="lsmith" name="Lukas Smith" email="[email protected]" />
<license>LGPL</license>
<version release="${version}" api="${version}" />
<stability release="${stability}" api="${stability}" />
<notes>-</notes>
<dependencies>
<php minimum_version="5.3.2" />
<pear minimum_version="1.6.0" recommended_version="1.6.1" />
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="${dependencies.common}" />
<package name="DoctrineSymfonyConsole" channel="pear.doctrine-project.org" minimum_version="2.0.0" />
<package name="DoctrineSymfonyYaml" channel="pear.doctrine-project.org" minimum_version="2.0.0" />
</dependencies>
<dirroles key="bin">script</dirroles>
<ignore>Doctrine/Common/</ignore>
<ignore>Symfony/Component/Yaml/</ignore>
<ignore>Symfony/Component/Console/</ignore>
<release>
<install as="doctrine-couchdb.php" name="bin/doctrine-couchdb.php" />
</release>
</d51pearpkg2>
<exec command="pear package" dir="${build.dir}/doctrine-odm" passthru="true" />
<exec command="mv CouchDBODM-${version}.tgz ../../dist" dir="${build.dir}/doctrine-odm" passthru="true" />
<tar destfile="dist/DoctrineCouchDB-ODM-${version}-full.tar.gz" compression="gzip" basedir="${build.dir}">
<fileset dir="${build.dir}">
<include name="**/**" />
<exclude name="logs/" />
<exclude name="doctrine-odm/package.xml" />
</fileset>
</tar>
</target>
<target name="git-tag">
<!-- COUCHDB -->
<exec command="grep '${version}-DEV' ${project.basedir}/lib/Doctrine/CouchDB/Version.php" checkreturn="true"/>
<exec command="sed 's/${version}-DEV/${version}/' ${project.basedir}/lib/Doctrine/CouchDB/Version.php > ${project.basedir}/lib/Doctrine/CouchDB/Version2.php" passthru="true" />
<exec command="mv ${project.basedir}/lib/Doctrine/CouchDB/Version2.php ${project.basedir}/lib/Doctrine/CouchDB/Version.php" passthru="true" />
<exec command="git add ${project.basedir}/lib/Doctrine/CouchDB/Version.php" passthru="true" />
<exec command="git commit -m 'Release ${version}'" />
<exec command="git tag -m 'Tag ${version}' -a ${version}" passthru="true" />
<!-- ODM -->
<exec command="grep '${version}-DEV' ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" checkreturn="true"/>
<exec command="sed 's/${version}-DEV/${version}/' ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php > ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version2.php" passthru="true" />
<exec command="mv ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version2.php ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" passthru="true" />
<exec command="git add ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" passthru="true" />
<exec command="git commit -m 'Release ${version}'" />
<exec command="git tag -m 'Tag ${version}' -a ${version}" passthru="true" />
</target>
<target name="pirum-release">
<exec command="sudo pirum add ${project.pirum_dir} ${project.basedir}/dist/CouchDB-${version}.tgz" dir="." passthru="true" />
<exec command="sudo pirum build ${project.pirum_dir}" passthru="true" />
<exec command="sudo pirum add ${project.pirum_dir} ${project.basedir}/dist/CouchDBODM-${version}.tgz" dir="." passthru="true" />
<exec command="sudo pirum build ${project.pirum_dir}" passthru="true" />
</target>
<target name="distribute-download">
<copy file="dist/DoctrineCouchDB-${version}-full.tar.gz" todir="${project.download_dir}" />
<copy file="dist/DoctrineCouchDB-ODM-${version}-full.tar.gz" todir="${project.download_dir}" />
</target>
<target name="update-dev-version">
<exec command="grep '${version}' ${project.basedir}/lib/Doctrine/CouchDB/Version.php" checkreturn="true"/>
<exec command="grep '${version}' ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" checkreturn="true"/>
<propertyprompt propertyName="next_version" defaultValue="${version}" promptText="Enter next version string (without -DEV)" />
<exec command="sed 's/${version}-DEV/${next_version}-DEV/' ${project.basedir}/lib/Doctrine/CouchDB/Version.php > ${project.basedir}/lib/Doctrine/CouchDB/Version2.php" passthru="true" />
<exec command="sed 's/${version}-DEV/${next_version}-DEV/' ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php > ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version2.php" passthru="true" />
<exec command="mv ${project.basedir}/lib/Doctrine/CouchDB/Version2.php ${project.basedir}/lib/Doctrine/CouchDB/Version.php" passthru="true" />
<exec command="mv ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version2.php ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" passthru="true" />
<exec command="git add ${project.basedir}/lib/Doctrine/CouchDB/Version.php" passthru="true" />
<exec command="git add ${project.basedir}/lib/Doctrine/ODM/CouchDB/Version.php" passthru="true" />
<exec command="git commit -m 'Bump Dev Version to ${next_version}-DEV'" passthru="true" />
</target>
<target name="release" depends="git-tag,build-packages,distribute-download,pirum-release,update-dev-version" />
</project>