forked from vitmalina/w2ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
169 lines (148 loc) · 5.83 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
<project name="w2ui" basedir="." default="build">
<property name="w2ui.version" value="/* w2ui 1.4.x (nightly) (c) http://w2ui.com, [email protected] */"/>
<property name="kickstart.version" value="/* kicstart 0.x (c) http://w2ui.com/kickstart, [email protected] */"/>
<target name="clean">
<delete file="dist/w2ui.css"/>
<delete file="dist/w2ui.min.css"/>
<delete file="dist/w2ui-dark.css"/>
<delete file="dist/w2ui-dark.min.css"/>
<delete file="dist/kickstart.css"/>
<delete file="dist/kickstart.min.css"/>
<delete file="dist/w2ui.js"/>
<delete file="dist/w2ui.min.js"/>
<delete file="dist/kickstart.js"/>
<delete file="dist/kickstart.min.js"/>
</target>
<target name="css">
<echo message="------- W2UI -------"/>
<!-- Compile w2ui.less files -->
<echo message="LESS: src/less/w2ui.less ==> dist/w2ui.css"/>
<exec executable="lessc" osfamily="unix">
<arg value="src/less/w2ui.less"/>
<arg value="dist/w2ui.css"/>
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c"/>
<arg value="lessc"/>
<arg value="src/less/w2ui.less"/>
<arg value="dist/w2ui.css"/>
</exec>
<!-- Minify w2ui.css files -->
<echo message="CleanCSS: dist/w2ui.css ==> dist/w2ui.min.css"/>
<exec executable="cleancss" output="dist/w2ui.min.css" osfamily="unix">
<arg value="dist/w2ui.css"/>
</exec>
<exec executable="cmd" output="dist/w2ui.min.css" osfamily="windows">
<arg value="/c"/>
<arg value="lessc"/>
<arg value="dist/w2ui.css"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${w2ui.version}${line.separator}" flags="s">
<fileset dir="dist" includes="w2ui.css" />
<fileset dir="dist" includes="w2ui.min.css" />
</replaceregexp>
<!-- Compile w2ui-dark.less files -->
<echo message="LESS: src/less/w2ui-dark.less ==> dist/w2ui-dark.css"/>
<exec executable="lessc" osfamily="unix">
<arg value="src/less/w2ui-dark.less"/>
<arg value="dist/w2ui-dark.css"/>
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c"/>
<arg value="lessc"/>
<arg value="src/less/w2ui-dark.less"/>
<arg value="dist/w2ui-dark.css"/>
</exec>
<!-- Minify w2ui.css files -->
<echo message="CleanCSS: dist/w2ui-dark.css ==> dist/w2ui-dark.min.css"/>
<exec executable="cleancss" output="dist/w2ui-dark.min.css" osfamily="unix">
<arg value="dist/w2ui-dark.css"/>
</exec>
<exec executable="cmd" output="dist/w2ui-dark.min.css" osfamily="windows">
<arg value="/c"/>
<arg value="cleancss"/>
<arg value="dist/w2ui-dark.css"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${w2ui.version}${line.separator}" flags="s">
<fileset dir="dist" includes="w2ui-dark.css" />
<fileset dir="dist" includes="w2ui-dark.min.css" />
</replaceregexp>
<!-- Kick Start -->
<echo message="------- KickStart -------"/>
<!-- Compile kickstart.less files -->
<echo message="LESS: src/kickstart/less/kickstart.less ==> dist/kickstart.css"/>
<exec executable="lessc" osfamily="unix">
<arg value="src/kickstart/less/kickstart.less"/>
<arg value="dist/kickstart.css"/>
</exec>
<exec executable="cmd" osfamily="windows">
<arg value="/c"/>
<arg value="lessc"/>
<arg value="src/kickstart/less/kickstart.less"/>
<arg value="dist/kickstart.css"/>
</exec>
<!-- Minify kickstart.css files -->
<echo message="CleanCSS: dist/kickstart.css ==> dist/kickstart.min.css"/>
<exec executable="cleancss" output="dist/kickstart.min.css" osfamily="unix">
<arg value="dist/kickstart.css"/>
</exec>
<exec executable="cmd" output="dist/kickstart.min.css" osfamily="windows">
<arg value="/c"/>
<arg value="cleancss"/>
<arg value="dist/kickstart.css"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${kickstart.version}${line.separator}" flags="s">
<fileset dir="dist" includes="kickstart.css" />
<fileset dir="dist" includes="kickstart.min.css" />
</replaceregexp>
</target>
<target name="js">
<echo message="------- W2UI -------"/>
<echo message="Concatenate JS Files"/>
<concat destfile="dist/w2ui.js">
<filelist dir="./src/" files="w2utils.js w2grid.js w2layout.js w2popup.js w2tabs.js w2toolbar.js w2sidebar.js w2fields.js w2form.js w2listview.js"/>
</concat>
<!-- Minify JS files -->
<echo message="Uglify-JS: /dist/w2ui.js ==> /dist/w2ui.min.js"/>
<exec executable="uglifyjs" output="dist/w2ui.min.js" osfamily="unix">
<arg value="dist/w2ui.js"/>
</exec>
<exec executable="cmd" output="dist/w2ui.min.js" osfamily="windows">
<arg value="/c"/>
<arg value="uglifyjs"/>
<arg value="dist/w2ui.js"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${w2ui.version}${line.separator}" flags="s">
<fileset dir="dist" includes="w2ui.js" />
<fileset dir="dist" includes="w2ui.min.js" />
</replaceregexp>
<!-- Kick Start -->
<echo message="------- KickStart -------"/>
<echo message="Concatenate JS Files"/>
<concat destfile="dist/kickstart.js">
<filelist dir="./src/kickstart" files="app.js"/>
</concat>
<!-- Minify JS files -->
<echo message="Uglify-JS: /dist/kickstart.js ==> /dist/kickstart.min.js"/>
<exec executable="uglifyjs" output="dist/kickstart.min.js" osfamily="unix">
<arg value="dist/kickstart.js"/>
</exec>
<exec executable="cmd" output="dist/kickstart.min.js" osfamily="windows">
<arg value="/c"/>
<arg value="uglifyjs"/>
<arg value="dist/kickstart.js"/>
</exec>
<echo message="Add Copyright Statement"/>
<replaceregexp match="^" replace="${kickstart.version}${line.separator}" flags="s">
<fileset dir="dist" includes="kickstart.js" />
<fileset dir="dist" includes="kickstart.min.js" />
</replaceregexp>
</target>
<target name="build" depends="clean,js,css">
<echo message="Wrapping Up"/>
</target>
</project>