build.xml
3.76 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
<?xml version="1.0" encoding="UTF-8" ?>
<project name="MyMailAdmin" basedir="." default="build">
<property name="src_dir" value="protected/" override="false"/>
<property name="build.dir" value="public/" override="false"/>
<property name="pkg" value="/tmp/mailadmin" override="false"/>
<target name="require">
<echo msg="This build requires:" />
<echo msg="Compass framework" />
<echo msg="YUI Compressor" />
</target>
<target name="minify">
<echo msg="Minimizing: ${filename}" />
<exec command="java -jar yuicompressor.jar ${ifile} -o ${ifile}" />
</target>
<target name="sass">
<echo msg="Building css file from sass configuration" />
<delete includeemptydirs="true" verbose="true" failonerror="true">
<fileset dir="${build.dir}/css">
<include name="*.css" />
</fileset>
</delete>
<exec command="cd ${build.dir}/sass/ && compass compile" checkreturn="true" />
<delete dir="${build.dir}/css/sass" includeemptydirs="true" verbose="true" failonerror="true" />
</target>
<target name="css" depends="sass">
<echo msg="CSS compiled" />
<copy todir="${build.dir}/css" overwrite="true">
<mapper type="glob" from="*.css" to="*.min.css"/>
<fileset dir="${build.dir}/css">
<include name="*.css" />
</fileset>
</copy>
<foreach param="filename" absparam="ifile" target="minify">
<fileset dir="${build.dir}/css">
<include name="*.min.css" />
</fileset>
</foreach>
</target>
<target name="clear.js">
<delete includeemptydirs="true" verbose="true" failonerror="true">
<fileset dir="${build.dir}">
<include name="app/controller/controller.js" />
<include name="app/view/view.js" />
<include name="app/model/model.js" />
<include name="scripts/app-debug.js" />
</fileset>
</delete>
</target>
<target name="js" depends="clear.js">
<fileset dir="${build.dir}/app/controller" id="controller.set">
<include name="*.js" />
<exclude name="controller.js" />
</fileset>
<fileset dir="${build.dir}/app/model" id="model.set">
<include name="*.js" />
<exclude name="model.js" />
</fileset>
<fileset dir="${build.dir}/app/store" id="store.set">
<include name="*.js" />
<exclude name="store.js" />
</fileset>
<append destFile="${build.dir}/app/controller/controller.js">
<fileset refid="controller.set" />
</append>
<append destFile="${build.dir}/app/model/model.js">
<fileset refid="model.set" />
</append>
<append destFile="${build.dir}/app/store/store.js">
<fileset refid="store.set" />
</append>
<append destFile="${build.dir}/app/view/view.js">
<filelist dir="${build.dir}/app/view" files="ProgramMenu.js, Taskpanel.js" />
<filelist dir="${build.dir}/app/view" files="Aliases.js, Alias.js" />
<filelist dir="${build.dir}/app/view" files="Users.js, User.js" />
<filelist dir="${build.dir}/app/view" files="Viewport.js, Authorize.js" />
<filelist dir="${build.dir}/app/view" files="Transports.js" />
</append>
<append destFile="${build.dir}/scripts/app-debug.js">
<filelist dir="${build.dir}/app" files="Overrides.js, view/view.js, model/model.js, store/store.js, controller/controller.js, Application.js" />
</append>
<copy todir="${build.dir}/scripts" overwrite="true">
<mapper type="glob" from="app-debug.js" to="app.js"/>
<filelist dir="${build.dir}/scripts" files="app-debug.js" />
</copy>
<foreach param="filename" absparam="ifile" target="minify">
<filelist dir="${build.dir}/scripts" files="app.js" />
</foreach>
</target>
<target name="build" depends="require, css, js">
<echo msg="All done." />
</target>
</project>