Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 277 lines (235 sloc) 9.644 kb
662798d
qiang.xue authored
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 /**
4 * Phing build file for Yii.
5 *
6 * @author Qiang Xue <qiang.xue@gmail.com>
7 * @link http://www.yiiframework.com/
6247ada Abdul Malik Ikhsan change copyright symbol
samsonasik authored
8 * @copyright 2008-2009 Yii Software LLC
662798d
qiang.xue authored
9 * @license http://www.yiiframework.com/license/
10 */
11 -->
12 <project name="yii" basedir="." default="help">
13 <!-- task definitions -->
14 <taskdef name="yii-init-build" classname="YiiInitTask" classpath="tasks" />
74081a0 * Refactored scenario-based model validation and massive assignments.
qiang.xue authored
15 <!--
4acb6c6 Add pear build target.
weizhuo authored
16 <taskdef name="yii-pear" classname="YiiPearTask" classpath="tasks"/>
74081a0 * Refactored scenario-based model validation and massive assignments.
qiang.xue authored
17 -->
662798d
qiang.xue authored
18
85826b6 Qiang Xue Fixed build script.
qiangxue authored
19 <!-- init yii.version, yii.revision and yii.winbuild -->
662798d
qiang.xue authored
20 <yii-init-build />
21
22 <!-- these are required external commands -->
23 <property name="php" value="php" /> <!-- PHP parser -->
24 <property name="hhc" value="hhc" /> <!-- compile phpdoc into CHM -->
25 <property name="pdflatex" value="pdflatex" /> <!-- generates PDF from LaTex -->
26
85826b6 Qiang Xue Fixed build script.
qiangxue authored
27 <property name="pkgname" value="${phing.project.name}-${yii.version}.${yii.revision}"/>
28 <property name="docname" value="${phing.project.name}-docs-${yii.version}.${yii.revision}"/>
4acb6c6 Add pear build target.
weizhuo authored
29 <property name="pearname" value="${phing.project.name}-${yii.release}.tgz" />
55bdd95 removed carriage returns from files.
qiang.xue authored
30
31 <!-- directory definitions -->
662798d
qiang.xue authored
32 <property name="build.base.dir" value="release"/>
33 <property name="build.dist.dir" value="${build.base.dir}/dist"/>
34 <property name="build.src.dir" value="${build.base.dir}/${pkgname}"/>
4acb6c6 Add pear build target.
weizhuo authored
35 <property name="build.pear.src.dir" value="${build.src.dir}/framework" />
662798d
qiang.xue authored
36 <property name="build.doc.dir" value="${build.base.dir}/${docname}"/>
37 <property name="build.web.dir" value="${build.base.dir}/web"/>
38
b95e032 Updated build scripts.
qiang.xue authored
39 <tstamp>
40 <format property="DATE" pattern="%b %e %Y" />
41 </tstamp>
42
7e9bf1e merge from 1.0
qiang.xue authored
43 <if>
44 <equals arg1="${yii.winbuild}" arg2="true"/>
45 <then>
46 <property name="build" value="build"/>
47 </then>
48 <else>
49 <property name="build" value="php build"/>
50 </else>
51 </if>
52
662798d
qiang.xue authored
53 <!-- source files in the framework -->
54 <fileset dir=".." id="framework">
2b2ab62 Maurizio Domba Cerin changed .svn to .gitignore in commands in build folder
mdomba authored
55 <exclude name="**/.gitignore"/>
662798d
qiang.xue authored
56 <exclude name="**/*.bak"/>
57 <exclude name="**/*~"/>
58 <include name="framework/**/*"/>
570a0ec added Hello World demo.
qiang.xue authored
59 <include name="requirements/**/*"/>
60 <include name="demos/**/*"/>
662798d
qiang.xue authored
61 <include name="CHANGELOG"/>
62 <include name="UPGRADE"/>
63 <include name="LICENSE"/>
64 <include name="README"/>
65 </fileset>
66
b2f0eec
qiang.xue authored
67 <!-- doc files -->
68 <fileset dir="../docs" id="docs">
2b2ab62 Maurizio Domba Cerin changed .svn to .gitignore in commands in build folder
mdomba authored
69 <exclude name="**/.gitignore"/>
b2f0eec
qiang.xue authored
70 <exclude name="**/*.bak"/>
71 <exclude name="**/*~"/>
72 <include name="guide/**/*"/>
b95e032 Updated build scripts.
qiang.xue authored
73 <include name="blog/**/*"/>
74 </fileset>
75
76 <fileset dir="../docs/guide" id="docs-guide">
2b2ab62 Maurizio Domba Cerin changed .svn to .gitignore in commands in build folder
mdomba authored
77 <exclude name="**/.gitignore"/>
b95e032 Updated build scripts.
qiang.xue authored
78 <exclude name="**/*.bak"/>
79 <exclude name="**/*~"/>
80 <include name="**/*"/>
81 </fileset>
82
83 <fileset dir="../docs/blog" id="docs-blog">
2b2ab62 Maurizio Domba Cerin changed .svn to .gitignore in commands in build folder
mdomba authored
84 <exclude name="**/.gitignore"/>
b95e032 Updated build scripts.
qiang.xue authored
85 <exclude name="**/*.bak"/>
86 <exclude name="**/*~"/>
87 <include name="**/*"/>
b2f0eec
qiang.xue authored
88 </fileset>
89
fcc2713 Added Phone Book demo.
qiang.xue authored
90 <fileset dir="." id="writables">
91 <include name="${build.src.dir}/**/runtime" />
92 <include name="${build.src.dir}/**/assets" />
93 <include name="${build.src.dir}/demos/**/data" />
94 </fileset>
95
96 <fileset dir="." id="executables">
97 <include name="${build.src.dir}/**/yiic" />
98 </fileset>
99
9488f00 merge from 1.0.
qiang.xue authored
100 <target name="src" depends="sync">
662798d
qiang.xue authored
101 <echo>Building package ${pkgname}...</echo>
102 <echo>Copying files to build directory...</echo>
103 <copy todir="${build.src.dir}">
104 <fileset refid="framework"/>
105 </copy>
fcc2713 Added Phone Book demo.
qiang.xue authored
106
107 <echo>Changing file permissions...</echo>
108 <chmod mode="0777">
109 <fileset refid="writables" />
110 </chmod>
111 <chmod mode="0755">
112 <fileset refid="executables" />
113 </chmod>
9488f00 merge from 1.0.
qiang.xue authored
114
115 <echo>Generating source release file...</echo>
116 <mkdir dir="${build.dist.dir}" />
117 <if>
118 <equals arg1="${yii.winbuild}" arg2="true"/>
119 <then>
120 <tar destfile="${build.dist.dir}/${pkgname}.tar.gz" compression="gzip">
121 <fileset dir="${build.base.dir}">
122 <include name="${pkgname}/**/*"/>
123 </fileset>
124 </tar>
125 </then>
126 <else>
127 <exec command="tar czpf ${pkgname}.tar.gz ${pkgname}" dir="${build.base.dir}"/>
128 <move file="${build.base.dir}/${pkgname}.tar.gz" todir="${build.dist.dir}" />
129 </else>
130 </if>
131 <zip destfile="${build.dist.dir}/${pkgname}.zip">
132 <fileset dir="${build.base.dir}">
133 <include name="${pkgname}/**/*"/>
134 </fileset>
135 </zip>
662798d
qiang.xue authored
136 </target>
137
9488f00 merge from 1.0.
qiang.xue authored
138 <target name="doc" depends="sync">
662798d
qiang.xue authored
139 <echo>Building documentation...</echo>
140
b6b1379
qiang.xue authored
141 <echo>Building Guide PDF...</echo>
7e9bf1e merge from 1.0
qiang.xue authored
142 <exec command="${build} guideLatex" dir="." passthru="true" />
1d21d29 merge from 1.0
qiang.xue authored
143 <exec command="${pdflatex} guide.tex -interaction=nonstopmode -max-print-line=120" dir="commands/guide" passthru="true"/>
144 <exec command="${pdflatex} guide.tex -interaction=nonstopmode -max-print-line=120" dir="commands/guide" passthru="true"/>
145 <exec command="${pdflatex} guide.tex -interaction=nonstopmode -max-print-line=120" dir="commands/guide" passthru="true"/>
146 <move file="commands/guide/guide.pdf" tofile="${build.doc.dir}/yii-guide-${yii.version}.pdf" />
147
148 <echo>Building Blog PDF...</echo>
149 <exec command="${build} blogLatex" dir="." passthru="true" />
150 <exec command="${pdflatex} blog.tex -interaction=nonstopmode -max-print-line=120" dir="commands/blog" passthru="true"/>
151 <exec command="${pdflatex} blog.tex -interaction=nonstopmode -max-print-line=120" dir="commands/blog" passthru="true"/>
152 <exec command="${pdflatex} blog.tex -interaction=nonstopmode -max-print-line=120" dir="commands/blog" passthru="true"/>
153 <move file="commands/blog/blog.pdf" tofile="${build.doc.dir}/yii-blog-${yii.version}.pdf" />
b2f0eec
qiang.xue authored
154
662798d
qiang.xue authored
155 <echo>Building API...</echo>
7e9bf1e merge from 1.0
qiang.xue authored
156 <exec command="${build} api ${build.doc.dir}" dir="." passthru="true" />
662798d
qiang.xue authored
157
d505aad Qiang Xue Fixed CTestCase for PHPUnit 3.7.10.
qiangxue authored
158 <!--
662798d
qiang.xue authored
159 <echo>Building API CHM...</echo>
160 <exec command="${hhc} ${build.doc.dir}/api/manual.hhp" />
161 <move file="${build.doc.dir}/api/manual.chm" tofile="${build.doc.dir}/yii-api-${yii.version}.chm" />
162 <delete>
163 <fileset dir="${build.doc.dir}/api">
164 <include name="manual.*" />
165 </fileset>
166 </delete>
d505aad Qiang Xue Fixed CTestCase for PHPUnit 3.7.10.
qiangxue authored
167 -->
9488f00 merge from 1.0.
qiang.xue authored
168
169 <echo>Generating doc release file...</echo>
170 <mkdir dir="${build.dist.dir}" />
171 <tar destfile="${build.dist.dir}/${docname}.tar.gz" compression="gzip">
172 <fileset dir="${build.base.dir}">
173 <include name="${docname}/**/*"/>
174 </fileset>
175 </tar>
176 <zip destfile="${build.dist.dir}/${docname}.zip">
177 <fileset dir="${build.base.dir}">
178 <include name="${docname}/**/*"/>
179 </fileset>
180 </zip>
662798d
qiang.xue authored
181 </target>
182
b2f0eec
qiang.xue authored
183 <target name="web" depends="sync">
b95e032 Updated build scripts.
qiang.xue authored
184
662798d
qiang.xue authored
185 <echo>Building online API...</echo>
b95e032 Updated build scripts.
qiang.xue authored
186 <mkdir dir="${build.web.dir}/common/data/${yii.version}" />
187 <exec command="${build} api ${build.web.dir}/common/data/${yii.version} online" dir="." passthru="true" />
9488f00 merge from 1.0.
qiang.xue authored
188
b95e032 Updated build scripts.
qiang.xue authored
189 <echo>Copying tutorials...</echo>
190 <copy todir="${build.web.dir}/common/data/${yii.version}/tutorials/guide">
191 <fileset refid="docs-guide"/>
192 </copy>
193 <copy todir="${build.web.dir}/common/data/${yii.version}/tutorials/blog">
194 <fileset refid="docs-blog"/>
195 </copy>
196
197 <echo>Copying release text files...</echo>
198 <mkdir dir="${build.web.dir}/frontend/www/files" />
199 <copy file="../CHANGELOG" tofile="${build.web.dir}/frontend/www/files/CHANGELOG-${yii.version}.txt" />
200 <copy file="../UPGRADE" tofile="${build.web.dir}/frontend/www/files/UPGRADE-${yii.version}.txt" />
201
202 <echo>
203
204 Finished building Web files.
205 Please update yiisite/common/data/versions.php file with the following code:
206
207 '1.1'=>array(
208 'version'=>'${yii.version}',
a99f1d5 Qiang Xue more build tool fixes.
qiangxue authored
209 'revision'=>'${yii.revision}',
b95e032 Updated build scripts.
qiang.xue authored
210 'date'=>'${yii.date}',
211 'latest'=>true,
212 ),
213
214 </echo>
662798d
qiang.xue authored
215 </target>
216
b2f0eec
qiang.xue authored
217 <target name="sync">
218 <echo>Synchronizing code changes for ${pkgname}...</echo>
662798d
qiang.xue authored
219
220 <echo>Building autoload map...</echo>
7e9bf1e merge from 1.0
qiang.xue authored
221 <exec command="${build} autoload" dir="." passthru="true"/>
662798d
qiang.xue authored
222
223 <echo>Building yiilite.php...</echo>
7e9bf1e merge from 1.0
qiang.xue authored
224 <exec command="${build} lite" dir="." passthru="true"/>
662798d
qiang.xue authored
225 </target>
226
9488f00 merge from 1.0.
qiang.xue authored
227 <target name="message">
228 <echo>Extracting i18n messages...</echo>
7e9bf1e merge from 1.0
qiang.xue authored
229 <exec command="${build} message ../framework/messages/config.php" dir="." passthru="true"/>
662798d
qiang.xue authored
230 </target>
231
74081a0 * Refactored scenario-based model validation and massive assignments.
qiang.xue authored
232 <!--
4acb6c6 Add pear build target.
weizhuo authored
233 <target name="pear" depends="clean,build">
234 <echo>Generating pear package for ${phing.project.name}-${yii.release}</echo>
235 <mkdir dir="${build.dist.dir}" />
236 <yii-pear pkgdir="${build.pear.src.dir}"
237 channel="pear.php.net"
238 version="${yii.release}"
239 state="stable"
240 category="framework"
241 package="${phing.project.name}"
242 summary="Yii PHP Framework"
243 pkgdescription="Yii PHP Framework: Best for Web 2.0 Development"
244 notes="http://www.yiiframework.com/files/CHANGELOG-${yii.release}.txt"
245 license="BSD"
246 />
247 <exec command="pear package" dir="${build.pear.src.dir}" passthru="true" />
248 <move file="${build.pear.src.dir}/${pearname}" tofile="${build.dist.dir}/${pearname}" />
249 </target>
74081a0 * Refactored scenario-based model validation and massive assignments.
qiang.xue authored
250 -->
4acb6c6 Add pear build target.
weizhuo authored
251
662798d
qiang.xue authored
252 <target name="clean">
253 <echo>Cleaning up the build...</echo>
254 <delete dir="${build.base.dir}"/>
255 </target>
256
257 <target name="help">
258 <echo>
259
260 Welcome to use Yii build script!
261 --------------------------------
262 You may use the following command format to build a target:
263
264 phing &lt;target name&gt;
265
266 where &lt;target name&gt; can be one of the following:
267
9488f00 merge from 1.0.
qiang.xue authored
268 - sync : synchronize yiilite.php and YiiBase.php
269 - message : extract i18n messages of the framework
270 - src : build source release
271 - doc : build documentation release (Windows only)
272 - clean : clean up the build
662798d
qiang.xue authored
273
274 </echo>
55bdd95 removed carriage returns from files.
qiang.xue authored
275 </target>
662798d
qiang.xue authored
276 </project>
Something went wrong with that request. Please try again.