1
<?xml version="1.0" encoding="UTF-8"?>
12
<project name="yii" basedir="." default="help">
14
<taskdef name="yii-init-build" classname="YiiInitTask" classpath="tasks" />
23
<property name="php" value="php" />
24
<property name="composer" value="composer" />
25
<property name="pdflatex" value="pdflatex" />
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}"/>
29
<property name="pearname" value="${phing.project.name}-${yii.release}.tgz" />
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}"/>
35
<property name="build.pear.src.dir" value="${build.src.dir}/framework" />
36
<property name="build.doc.dir" value="${build.base.dir}/${docname}"/>
37
<property name="build.web.dir" value="${build.base.dir}/web"/>
40
<format property="DATE" pattern="%b %e %Y" />
44
<equals arg1="${yii.winbuild}" arg2="true"/>
46
<property name="build" value="build"/>
49
<property name="build" value="php build"/>
54
<fileset dir=".." id="framework">
55
<exclude name="**/.gitignore"/>
56
<exclude name="**/*.bak"/>
57
<exclude name="**/*~"/>
58
<include name="framework/**/*"/>
59
<include name="requirements/**/*"/>
60
<include name="demos/**/*"/>
61
<include name="CHANGELOG"/>
62
<include name="UPGRADE"/>
63
<include name="LICENSE"/>
64
<include name="README"/>
68
<fileset dir="../docs" id="docs">
69
<exclude name="**/.gitignore"/>
70
<exclude name="**/*.bak"/>
71
<exclude name="**/*~"/>
72
<include name="guide/**/*"/>
73
<include name="blog/**/*"/>
76
<fileset dir="../docs/guide" id="docs-guide">
77
<exclude name="**/.gitignore"/>
78
<exclude name="**/*.bak"/>
79
<exclude name="**/*~"/>
80
<include name="**/*"/>
83
<fileset dir="../docs/blog" id="docs-blog">
84
<exclude name="**/.gitignore"/>
85
<exclude name="**/*.bak"/>
86
<exclude name="**/*~"/>
87
<include name="**/*"/>
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" />
96
<fileset dir="." id="executables">
97
<include name="${build.src.dir}/**/yii" />
100
<target name="src" depends="sync">
101
<echo>Building package ${pkgname}...</echo>
102
<echo>Copying files to build directory...</echo>
103
<copy todir="${build.src.dir}">
104
<fileset refid="framework"/>
107
<echo>Changing file permissions...</echo>
109
<fileset refid="writables" />
112
<fileset refid="executables" />
115
<echo>Generating source release file...</echo>
116
<mkdir dir="${build.dist.dir}" />
118
<equals arg1="${yii.winbuild}" arg2="true"/>
120
<tar destfile="${build.dist.dir}/${pkgname}.tar.gz" compression="gzip">
121
<fileset dir="${build.base.dir}">
122
<include name="${pkgname}/**/*"/>
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}" />
131
<zip destfile="${build.dist.dir}/${pkgname}.zip">
132
<fileset dir="${build.base.dir}">
133
<include name="${pkgname}/**/*"/>
138
<target name="doc" depends="sync">
139
<echo>Building documentation...</echo>
141
<echo>Building Guide PDF...</echo>
142
<exec command="${build} guideLatex" dir="." passthru="true" />
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" />
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" />
155
<echo>Building API...</echo>
156
<exec command="${build} api ${build.doc.dir}" dir="." passthru="true" />
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}/**/*"/>
176
<zip destfile="${build.dist.dir}/${docname}.zip">
177
<fileset dir="${build.base.dir}">
178
<include name="${docname}/**/*"/>
183
<target name="web" depends="sync">
185
<echo>Building online API...</echo>
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" />
189
<echo>Copying tutorials...</echo>
190
<copy todir="${build.web.dir}/common/data/${yii.version}/tutorials/guide">
191
<fileset refid="docs-guide"/>
193
<copy todir="${build.web.dir}/common/data/${yii.version}/tutorials/blog">
194
<fileset refid="docs-blog"/>
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" />
204
Finished building Web files.
205
Please update yiisite/common/data/versions.php file with the following code:
208
'version'=>'${yii.version}',
209
'revision'=>'${yii.revision}',
210
'date'=>'${yii.date}',
218
<echo>Synchronizing code changes for ${pkgname}...</echo>
220
<echo>Building autoload map...</echo>
221
<exec command="${build} autoload" dir="." passthru="true"/>
223
<echo>Building yiilite.php...</echo>
224
<exec command="${build} lite" dir="." passthru="true"/>
227
<target name="message">
228
<echo>Extracting i18n messages...</echo>
229
<exec command="${build} message ../framework/messages/config.php" dir="." passthru="true"/>
252
<target name="clean">
253
<echo>Cleaning up the build...</echo>
254
<delete dir="${build.base.dir}"/>
260
Welcome to use Yii build script!
261
--------------------------------
262
You may use the following command format to build a target:
264
phing <target name>
266
where <target name> can be one of the following:
268
- sync : synchronize yiilite.php and BaseYii.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