build.xml
5.55 KB
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
<?xml version="1.0" encoding="UTF-8" ?>
<project name="MTAWeb" basedir="." default="build">
<property name="source.dir" value="." override="false"/>
<property name="build.dir" value="build" override="false"/>
<target name="minify">
<echo msg="Minimizing: ${filename} == ${ifile}" />
<exec checkreturn="true" command="java -jar ${source.dir}/contrib/webcompress/yuicompressor.jar --preserve-semi ${ifile} -o ${ifile}" />
</target>
<target name="copy">
<delete dir="${source.dir}/${build.dir}" quiet='true' includeemptydirs="true" />
<mkdir dir="${source.dir}/${build.dir}" />
<copy todir="${source.dir}/${build.dir}" overwrite="true">
<fileset dir="${source.dir}">
<include name="framework/**" />
<include name="public/protected/**" />
<include name="public/images/**" />
<include name="public/index.php" />
<include name="public/.htaccess" />
</fileset>
</copy>
</target>
<target name="sass">
<echo msg="Building css file from sass configuration" />
<exec command="cd ${source.dir}/public/sass/ && compass compile" checkreturn="true" />
</target>
<target name="css" depends="sass">
<mkdir dir="${build.dir}/public/css" />
<copy todir="public/css" overwrite="true">
<mapper type="glob" from="*theme.css" to="*theme.min.css"/>
<fileset dir="public/css">
<include name="*theme.css" />
</fileset>
</copy>
<foreach param="filename" absparam="ifile" target="minify">
<fileset dir="public/css">
<include name="*theme.min.css" />
</fileset>
</foreach>
<copy todir="${build.dir}/public/css" overwrite="true">
<fileset dir="public/css">
<include name="*theme*.css" />
</fileset>
</copy>
</target>
<target name="clear.js">
<delete includeemptydirs="true" verbose="true" failonerror="true">
<fileset dir="public/">
<include name="app/controller/controller.js" />
<include name="app/model/model.js" />
<include name="app/store/store.js" />
<include name="app/view/view.js" />
<include name="scripts/app.js" />
<include name="scripts/app-debug.js" />
</fileset>
</delete>
</target>
<target name="js" depends="clear.js">
<mkdir dir="${build.dir}/public/scripts" />
<fileset dir="public/app/controller" id="controller.set">
<include name="*.js" />
<exclude name="controller.js" />
</fileset>
<fileset dir="public/app/model" id="model.set">
<include name="*.js" />
<exclude name="model.js" />
</fileset>
<fileset dir="public/app/store" id="store.set">
<include name="*.js" />
<exclude name="store.js" />
</fileset>
<append destFile="public/app/controller/controller.js">
<fileset refid="controller.set" />
</append>
<append destFile="public/app/model/model.js">
<fileset refid="model.set" />
</append>
<append destFile="public/app/store/store.js">
<fileset refid="store.set" />
</append>
<append destFile="public/app/view/view.js">
<filelist dir="public/app/view" files="ProgramMenu.js, Taskpanel.js" />
<filelist dir="public/app/view" files="Aliases.js, Alias.js" />
<filelist dir="public/app/view" files="Users.js, User.js" />
<filelist dir="public/app/view" files="Viewport.js, Authorize.js" />
<filelist dir="public/app/view" files="Transports.js" />
</append>
<append destFile="public/scripts/app-debug.js">
<filelist dir="public/app" files="Overrides.js, view/view.js, model/model.js, store/store.js, controller/controller.js, Application.js" />
</append>
<copy todir="public/scripts" overwrite="true">
<mapper type="glob" from="app-debug.js" to="app.js"/>
<filelist dir="public/scripts" files="app-debug.js" />
</copy>
<foreach param="filename" absparam="ifile" target="minify">
<filelist dir="public/scripts" files="app.js" />
</foreach>
<copy todir="${build.dir}/public/scripts" overwrite="true">
<fileset dir="public/scripts">
<include name="**/app.js" />
<include name="**/app-debug.js" />
<include name="**/ext-all.js" />
<include name="**/ext-all-debug.js" />
</fileset>
</copy>
</target>
<target name="build" depends="copy, css, js">
<exec checkreturn="true" command="find ${build.dir} -type f -exec chmod 644 {} \;" />
<chmod file="${build.dir}/public/protected/runtime" mode="0777" failonerror="true" verbose="true" />
<reflexive>
<fileset dir="${build.dir}/public">
<include name="index.php" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="(define[\(\"\'\s]+YII_DEVELOP[\)\,\"\'\s]+)[\w\-\_]+"
replace="\1false" />
<regexp pattern="(define[\(\"\'\s]+YII_DEBUG[\)\,\"\'\s]+)[\w\-\_]+"
replace="\1false" />
</replaceregexp>
</filterchain>
</reflexive>
<tar destfile="${source.dir}/${build.dir}/mtaweb.tar.gz" compression="gzip">
<fileset dir="${source.dir}/${build.dir}">
<include name="framework/**" />
<include name="public/**" />
</fileset>
</tar>
</target>
</project>